Dear Sir/Madam,
I have two dropdownProviders in the WebDatagrid default AddRow at the bottom field. The first dropdownprovide using sqldatasource to bind in the client, and the datasource of 2nd dropdownprovider binded from the server.
I would like to make this two cells as optional field, user can either select the value from the dropdown, or clear the cell/or select item "--None--"
When I set the "EnableCustomValue = false", the first dropdownprovider will show the default 1st item in the list box, however, if the user click the first item, the item cannot be save in the cell, means when you move to another cell, the first cell still showing blank. But this case won't happen if you are not selecting the 1st dropdown item at the 1st time. May I know how to resolve this issue?
I'm thinking if I can bind 1 more extra item call "--None--" show on the 1st row of the list, maybe can solve the issue as well.
But how can I bind this extra Value to the dropdownprovider? I tried the following methods but not working.
1.Set the currentValue in the client or
2. In server do databound and called in page_load (but this method works fine for 2nd dropdownProvider )
public void drpPrjBU_DataBound(object sender, EventArgs e)
{
DropDownProvider ddlProjBU = (DropDownProvider)this.grd_MHC.EditorProviders.GetProviderById("grd_drpProjBU");
ddlProjBU.EditorControl.Items.Insert(0, new Infragistics.Web.UI.ListControls.DropDownItem("--None--", "0"));
}
3. However, the 2nd dropdownProvider can successfully bind the '--None--' value for the first time only. means the users are not able to select back the --None-- again if they select other item.
----The following is my HTML for your reference---
<ig:WebDataGrid ID="grd_MHC" runat="server" Width="400px" AutoGenerateColumns="False" DataKeyFields="Id" OnRowAdding="grd_MHC_RowAdding" >
<Columns>
<ig:BoundDataField Key="Id" Hidden="true">
</ig:BoundDataField>
<ig:BoundDataField Key="BU">
<Header Text="Project BU">
</Header>
<ig:BoundDataField Key="Project">
<Header Text="Project">
<ig:BoundDataField Key="WBS">
<Header Text="WBS">
</Columns>
<EditorProviders>
<ig:DropDownProvider ID="grd_drpProjBU">
<EditorControl ClientIDMode="Predictable" DataSourceID="SqlDataSource1" DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" TextField="CompanyDesc" ValueField="CompanyCode" DataKeyFields="CompanyCode" runat="server">
<DropDownItemBinding TextField="CompanyDesc" ValueField="CompanyCode" />
</EditorControl>
</ig:DropDownProvider>
<ig:DropDownProvider ID="grd_drpProject">
<editorcontrol dropdowncontainermaxheight="200px" enableanimations="False" enablecustomvalues="False" enabledropdownaschild="False" CurrentValue="0" runat="server" OnItemsRequested="drpProj_OnItemRequested" >
</editorcontrol>
</EditorProviders>
<Behaviors>
<ig:EditingCore AutoCRUD="False">
<ig:RowAdding>
<ColumnSettings>
<ig:RowAddingColumnSetting ColumnKey="BU" EditorID="grd_drpProjBU" />
<ig:RowAddingColumnSetting ColumnKey="Project" EditorID="grd_drpProject" />
</ColumnSettings>
<AddNewRowClientEvents EnteredEditMode="grd_MHC_drpPrjBU_EditedMode"/>
<EditModeActions MouseClick="Single" />
</ig:RowAdding>
</Behaviors>
</ig:EditingCore>
<ig:Selection CellClickAction="Row" RowSelectType="Single">
</ig:Selection>
<ig:RowSelectors>
</ig:RowSelectors>
</ig:WebDataGrid>
Please advise and Thanks in advance,
Regards,
BH
Hi any suggestions?
Hi BH,
I am currently looking into this issue and have been successful in reproducing the inability to select the first item in the provider when CustomValues are disabled in a test sample. I am currently researching the matter further and will keep you posted of my progress.
Please do not hesitate to contact me with any updates or questions in the meantime.
Hello BH,
There appears to be an existing development issue regarding this matter - 170661. I have created a support ticket for you regarding this matter - CAS-138403-P7P8Z0 and am linking your case to this item. You will receive a notification once a fix is made available through a service release.
Please do not hesitate to contact me if you need more information.
I am also facing same problem. I want to add first element as a None and asssign value to null like dropdownlist in c#.
Is it Possible in infragistics?