note: the name of the field on the datatable that has the default value is "resource"
Hello,
I'll try my best to explain what I'm attempting to do. I have a datatable that contains (let's say) Resource and Resource ID. Resource may or may not be populated (i.e. it could be blank). Moreover, Resource needs to be selected from a dropdown menu. Therefore, what I'm trying to do is make my grid look something like
http://samples.infragistics.com/2009.1/WebFeatureBrowser/Default.aspx
where there are no instances of the drop down maintained until the cell is clicked to enter edit mode. However, if there already is a value set for resource, I would like that value selected in the cell (without loading the actual drop down control). I can only get my table to bind to the grid as text or get the drop downs to bind without the default values showing.
How can I do this using the WebGrid? Thanks in advance! Below is the code I'm using (which binds the text correctly, but doesn't implement the drop down)
note: the name of the field on the datatable that has the value I'm looking for is "resource"
<%-- COMBO BOX -->
<igcmbo:webcombo id="ResourceCB" runat="server" Version="3.00" DataValueField="last_name" DataTextField="last_name" DataSourceID="SqlDataSource5"> <Columns> <igtbl:UltraGridColumn BaseColumnName="last_name" IsBound="True" Key="last_name"> <header caption="last_name"></header> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="first_name" IsBound="True" Key="first_name"> <header caption="first_name"> <RowLayoutColumnInfo OriginX="1" /> </header> <Footer> <RowLayoutColumnInfo OriginX="1" /> </Footer> </igtbl:UltraGridColumn> </Columns> ... </igcmbo:webcombo>
<%-- GRID -->
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="ObjectDataSource2" > <Bands>
...
<igtbl:UltraGridColumn BaseColumnName="Resource" IsBound="True" Key="resource" EditorControlID="ResourceCB" Type="Custom"> <Header Caption="Resource"> <RowLayoutColumnInfo OriginX="4" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="4" /> </Footer> </igtbl:UltraGridColumn>
Apology for the delayed answer but it can be useful for some other guys. So, I would suggest use built-in column type DropDwon / ValueLIst :
Here you can refer this link :
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.1/CLR3.5/html/WebGrid_Displaying_and_Storing_Values_with_ValueLists.html
Another sample showing Changing ValueLists on a Per-Row Basis
Hope this helps