|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help needed with DataGrid Client-Side ScriptingHi,
I have a custom ASP.Net DataGrid Control which has DropDownLists in each of the HeaderCells of the Grid. I'm not able to get the ClientID that is automatically assigned to the DropDownLists. I need help. Please send your suggessions ASAP You can either do it in a hard way or and easier way. The hard way is to get
ClientID in ItemDataBind event followed by Page.RegisterArrayDeclaration() to pass them to the client.... I have tested this logic yet and I think it should work. The easy way is, MS names the clientIDs for those DDLs in a very consistent manner. Compile and run your application without any JS, then view the html source and you will find out how MS names those clientIDs. I use this in my applicaiton and it works very well. Here is one thing I need to make a note: Asp.net won't be able to "remember" the ddlselection changes so you cannot get DDL's updated selection by using DDL.SelectedValue or DDL.SelectedIndex property on server side. What I did was to use HiddenFields to carry those updated values. Hope it helps. Show quoteHide quote "Subba Rao via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message news:0eaa0c973a99405f809d74452313ba0b@DotNetMonster.com... > Hi, > > I have a custom ASP.Net DataGrid Control which has DropDownLists in each > of the HeaderCells of the Grid. I'm not able to get the ClientID that is > automatically assigned to the DropDownLists. I need help. Please send your > suggessions ASAP > > -- > Message posted via http://www.dotnetmonster.com Thank you for replying. I solved the issue, the ClientID of the dropdown
list gave me the ID of the dropdown list on the Grid Headers. Thanks alot.
e.Item.DataItem
2 Performance Questions Avoid adding a new record on refreshing the browser Underline a whole row for a particular row CancelCommand Event Handler Not Firing dataView Embedded DropDownList in column. Viewstate question DataGrid & Form on Same Page Post Issue populating a datagrid from an array |
|||||||||||||||||||||||