Hi all,
I was trying to select a particular value from dropdown which is a column type of Ultrawebgrid.
I populated the older rows in ultrawebgrid.But couldnt set the index of the column type dropdown to the database value ...
I need to set the index dynamically of that column ....please reply as soon as possible.
Hello,
I believe you can achieve that using templated columns. In a templated column you can have any content - for example you can start with just a dropdown in the templated column, e.g.
<igtbl:TemplatedColumn> <CellTemplate> <asp:dropdownlist runat ... /> </CellTemplate></igtbl:TemplatedColumn>
and then in InitializeRow, you can do something similar to this (pseudo code, just for reference)
TemplatedColumn col = (TemplatedColumn)e.Row.Cells.FromKey("SomeKey").Column;CellItem ci = (CellItem)col.CellItems[e.Row.Index];DropDownList dropDown = (DropDownList) ci.FindControl("placeHolder1"); if (e.Row.Index == 5)
dropDown.SelectedIndex = 3;
It is very hard to advise, since from what I see this is a full-blown application with a lot of custom requirements. I think a good place to start in situations like this is going through the complete
Quick Guide to Implementing the NetAdvantage UltraWebGrid in a Real Life Scenario article here:
http://dotnetslackers.com/articles/aspnet/QuickGuideToImplementingTheNetAdvantageUltraWebGrid.aspx
which provides great information on how to work with the grid in cases like that. You can also go through the online grid samples available here:
http://samples.infragistics.com/2008.3/WebFeatureBrowser/Default.aspx
and finallythough our online documentation here:
http://es.infragistics.com/support/documentation.aspx
Hi
I found how to implement the functions which i want to do from the links provided by you.
I still got one problem like i was not able to add new row from javascript if the grid doesnt have any records because i get the error as "grid = undefined
i m using initialise datasource and layout for the grid.Can you help me out to rectify this error?
It really depends how you get the grid on the client-side. Typically you get the client side instance of the grid with the igtbl_getGridById client-side function documented here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebGrid_Utility_Functions_CSOM.html
Is this working for you? If not, what is different / special in your setup?
i m sending you the code..i m using right now,
oGrid = igtbl_getGridById(grid);
but this doesnt work ...
var oNewRow = igtbl_addNew(oGrid, 0);
but i failed to execute.
i send the parameters for this function as AddNewRow('taskgrid.ClientID')
i want to addrow when there is no rows in the gird also...
tell me where am i going wrong...
I have same requirement, but need to fetch the selected value from dropdown list from javascript.
I was trying to do so like
grid.Rows.getRow(num).getCellFromKey(
"Type").getValue(0)
Thanks
Sandip
yes, you are right... i got it worked now... thanks a lot.
I successfully added and saved the row.But when the page is posted back , the newly added row appears, but its details such as grid.rows.count doesnot taken into account of newly added row.
How do i correct this.