Showing posts with label mode. Show all posts
Showing posts with label mode. Show all posts

Monday, March 26, 2012

Populate asp:label with text from db and retain formatting?

set the text box Text Mode property to MultiLine.

Av.

"Tony" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:7B9C3796-02D8-4180-AD93-8572746CD951@dotnet.itags.org.microsoft.com...
> Hello,
> Im can't seem to figure this out OR find any documentation on if it's
> possible; I need to populate the value of an asp:label with text retrieved
> from the database. However when the text is populated I need to retain
> carriage returns and indents that the text contains. That way if I want to
> see this:
> Some text with a manual
> carriage return.
> 1. this is one.
> 2. this is two.
> It doesn't look like this:
> Some text with a manual carriage return. 1. this is one. 2. this is two.
> I've tried enclosing the text in <pre></pre> tags before the text is
> assigned to the label and it works fine except for 2 things. The text is
> rendered in a non-styled font and in the instance that the user entered
> really long text and didn't manullay hit a carriage return- which causes
> the text continue to the right instead of automatically wrapping even
> though I define a width on my label, the cell the label is within, etc..
> Does anyone know how to get this to work? I must have looked around on the
> net for hours!TextMode is not a property for a label but a textbox. I have tried using a textbox control with this property set to multiline previously however without specifically setting the height of the textbox I end up with vertical scrollbars- which I cannot have because this is for a printable report.

Saturday, March 24, 2012

Populate dropdown

Hy Guys,

I have a datagrid that, in the edititem mode, have a dropdownlist. This
dropdownlist have to be populated with the items of another dropdownlist
that is in the same page.

How can I do it??

Thank'sthis is what you need

http://msdn.microsoft.com/library/d...stomcolumns.asp

--
Regards,

HD

"Andr Almeida Maldonado" <deweb@.bol.com.br> wrote in message
news:ebVFaqi2DHA.2428@.tk2msftngp13.phx.gbl...
> Hy Guys,
> I have a datagrid that, in the edititem mode, have a dropdownlist. This
> dropdownlist have to be populated with the items of another dropdownlist
> that is in the same page.
> How can I do it??
> Thank's

Populate foreign key in InsertTemplate of FormView

Hello all,

How would I populate a foreign key value in a label field of a FormView when
FormView changes mode to Insert? So that I can insert foreign key.

Explanation:
Suppose there are two tables in database, EMPLOYEE (list of employees) and
EMPLOYEE_DOCS (list of documents of every employee). table EMPLOYEE_DOCS
have a foreign key field EMPLOYEE_ID. When I use FormView's Insert mode for
EMPLOYEE_DOCS, I want to to explicitly take foreign key, so that it wont go
blank when inserting in database or user wont need to type it. I have
everything in Panels (webcontrol)

Thank you for help.
MirajThanks all, I figured out

I did this:

Protected Sub FormView1_ItemInserting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.FormViewInsertEventArgs) Handles
FormView1.ItemInserting

e.Values("EMPLOYEE_ID") =
GridView1.Rows(GridView1.SelectedIndex).Cells(1).T ext ' cells(1).text is the
foreign key

End Sub

"Miraj Haq" <mirajhaq-n-o-s-p-a-m@.yahoo.com> wrote in message
news:epbuhXYhFHA.1444@.TK2MSFTNGP10.phx.gbl...
> Hello all,
> How would I populate a foreign key value in a label field of a FormView
> when FormView changes mode to Insert? So that I can insert foreign key.
> Explanation:
> Suppose there are two tables in database, EMPLOYEE (list of employees) and
> EMPLOYEE_DOCS (list of documents of every employee). table EMPLOYEE_DOCS
> have a foreign key field EMPLOYEE_ID. When I use FormView's Insert mode
> for EMPLOYEE_DOCS, I want to to explicitly take foreign key, so that it
> wont go blank when inserting in database or user wont need to type it. I
> have everything in Panels (webcontrol)
> Thank you for help.
> Miraj