Hi all,
I have a dropdownprovider multi-column. Here is my source:
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Width="100%" AutoGenerateColumns="False" rowheightdefault="20px" Font-Bold="False" EnableDataViewState="True" BorderWidth="0px" BorderStyle="Solid" BorderColor="Silver" DataKeyFields="ID" EnableAjax="False"> <Columns> <ig:BoundDataField DataFieldName="ID" Hidden="True" Key="ID"> </ig:BoundDataField> <ig:BoundDataField CssClass="NormalTextLeft" DataFieldName="AMENITY_ITEM_LKUP_ID" Key="AMENITY_ITEM_LKUP_ID" Width="25%"> <Header Text="Amenity Item"> </Header> </ig:BoundDataField> <ig:BoundDataField CssClass="NormalTextLeft" DataFieldName="QTY_AMT" Key="QTY_AMT" Width="15%"> <Header Text="Qty."> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="COMMENTS" Key="COMMENTS" Width="60%"> <Header Text="Select"> </Header> </ig:BoundDataField> </Columns> <EditorProviders> <ig:DropDownProvider ID="DropDownProvider1"> <EditorControl ClientIDMode="Predictable" DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" DataKeyFields="ID" EnableCachingOnClient="False"> <ClientEvents DropDownOpening="UG_AMENITIES_UNIT_DropDown_DropDownOpening" /> <Items> <ig:DropDownItem CssClass="HeaderCaptionClass" Target="WDG_DropDown"></ig:DropDownItem> </Items> <ItemTemplate> <ig:WebDataGrid runat="server" ID="WDG_DropDown" Width="100%" Font-Bold="False" ShowHeader="False" EnableAjax="false" ValidateRequestMode="Disabled" ClientIDMode="AutoID" AutoGenerateColumns="False" DataKeyFields="ID" EnableTheming="False" EnableViewState="False" EnableAjaxViewState="False"> <Behaviors> <ig:Filtering Enabled="true" Visibility="Hidden"> </ig:Filtering> <ig:Activation Enabled="False"> </ig:Activation> <ig:Selection CellClickAction="Row" RowSelectType="Single"> <SelectionClientEvents /> </ig:Selection> <ig:RowSelectors Enabled="False"></ig:RowSelectors> </Behaviors> <Columns> <ig:BoundDataField DataFieldName="ID" Hidden="True" Key="ID"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Descr" Key="Descr"> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Rec_Code" Hidden="True" Key="Rec_Code"> </ig:BoundDataField> </Columns> </ig:WebDataGrid> </ItemTemplate> </EditorControl> </ig:DropDownProvider> </EditorProviders> <Behaviors> <ig:RowSelectors> </ig:RowSelectors> <ig:EditingCore AutoCRUD="False" BatchUpdating="True"> <EditingClientEvents /> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="AMENITY_ITEM_LKUP_ID" EditorID="DropDownProvider1" /> </ColumnSettings> <EditModeActions EnableOnActive="True" MouseClick="Single"></EditModeActions> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:Selection> </ig:Selection> <ig:Activation> </ig:Activation> <ig:Filtering Visibility="Hidden" Enabled="True"> <ColumnSettings> <ig:ColumnFilteringSetting ColumnKey="AMENITY_ITEM_LKUP_ID" EditorID="UG_AMENITIES_UNIT_DropDow" /> </ColumnSettings> </ig:Filtering> </Behaviors> </ig:WebDataGrid>
I have two questions:
1. How can I set CSS for alternate row of WDG in Dropdown ItemTemplate (by client-side or server-side)
2. My dropdownprovider always have an empty item, how can I remove it? (I attached image for issue)
Hello M,
Regarding the empty row in the DropDown's templated grid, I would suggest investigating the grid's datasource to determine whether an empty row is not present at the top.
Styling the templated grid's rows may be achieved in a similar fashion as to how this is done in a regular grid - by using the ItemCssClass and AltItemCssClass properties as described at:
http://es.infragistics.com/community/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx
By following the instructions in the given guide, the templated grid's classes may be set either from the markup or code behind.
Hope this helps. Please do not hesitate to contact me if you have any questions.
Please feel free to contact me if you are still experiencing issues with this matter.