Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I Selected Editable Grid Screen in Light switch,
In this grid I have 4 fields Name, Description, createdbyuser,ModifiedByuser

createdbyuser needs to be set as current username. In a datagrid how do I assign value to that cell.
ModifiedByuser is need to be set only when modifying or editing the record.

I have set authentication on and I can get current user name by application.user.name
but how do I assign them to the cell in the grid.

your help is most appreciated.

Thank you,
Posted

1 solution

Kindly mention the framework version used to give a clear answer for it.



To get a data from a cell from a datagrid


if it's the first row then

ctype(dgrd.Items(0).cells(0).Controls(0),DataboundLiteralControl).Text

In the immediate window while debugging check the no. of controls available in the particular cell. If you are using a label inside a Template column, then you can directly typecast to Label and you can use.

For more details about this kindly mention the framework details and the asp.net coding for datagrid alone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900