Hi,
I am facing a weird problem. I am unable figure out the mistake in my code. Here is my problem:
I've set EditrorControlID of a column in a webgrid to webdatechooser and another column's EditorControlID to a webcombo. Initially, when the page loads, these two controls are getting displayed on the screen (figure 1). How can they be in default hidden state? When the grid actually has data and I clik in the respective cell, then the controls disappear form the initial place where they are displayed. It works fine after that (figure 2).
Another problem as you can see here (figure 3) is that the dropdown values are not getting displayed completely. Here is the markup for that:
<igsch:WebDateChooser ID="DynamicWebDateChooser" runat="server" StyleSetName="Office2007Black" EnableAppStyling="true" StyleSetPath="~/ig_res/"> <ExpandEffects Type="Fade" Opacity="100" ShadowWidth="1" /> <ClientSideEvents AfterCloseUp="StartDateWebDateChooser_AfterCloseUp" /> </igsch:WebDateChooser> <igcmbo:webcombo id="CommentsSignoffCombo" runat="server" Width="165px" Font-Names="Verdana" Font-Size="10pt" Version="4.00" StyleSetName="RubberBlack" EnableAppStyling="true" StyleSetPath="~/ig_res/"> <ExpandEffects ShadowColor="LightGray"></ExpandEffects> <DropDownLayout bordercollapse="Separate" colheadersvisible="No" gridlines="Horizontal" rowheightdefault="20px" DropdownWidth="165px" rowselectors="No" tablelayout="Fixed" DropdownHeight="100px" version="4.00"> <framestyle backcolor="Silver" borderstyle="Ridge" borderwidth="2px" cursor="Default" font-names="Verdana" font-size="10pt" height="100px" width="165px"> </framestyle> <RowStyle BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt"> <BorderDetails WidthLeft="0px" WidthTop="0px" /> </RowStyle> </DropDownLayout> </igcmbo:webcombo>
Please help me with this.
Thanks,
Kala
Issue 1 (hide control at load time): You could set Visible="false" to both the controls. It will be displayed automatically when data is populated in it.
Issue 2 (drop down value display): Try setting ColWidthDefault and TableLayout properties.
Please let me know if this works for you.
Issue 2 is resolved by setting the TableLayout to Auto in DropdownLayout and also by setting the DropdownWidth. Thanks for that info!
But issue 1 is not resolved by setting visible="false" for the controls. They are not visible even after entering the cells of the grid in edit mode. We need to program them by setting the visible property to true again. It shouldn't be the case. I've seen ASP.Net samples of Infragistics controls and they didn't set any such property.
Here I am giving the markup of my grid and also code where I set EditorControlID:
***
<igtbl:UltraWebGrid id="AdobeProofSummaryGrid" runat="server" oninitializelayout="AdobeProofSummaryGrid__InitializeLayout"> <DisplayLayout CompactRendering="False" StationaryMargins="Header" AllowSortingDefault="OnClient" RowHeightDefault="20px" AllowColumnMovingDefault="OnServer" SelectTypeCellDefault="Extended" BorderCollapseDefault="Separate" AllowColSizingDefault="Free" CellClickActionDefault="Edit" AllowUpdateDefault="Yes" AllowDeleteDefault="Yes" AllowAddNewDefault="Yes" RowSelectorsDefault="No" HeaderClickActionDefault="SortMulti" Version="4.00" ViewType="Flat" Name="AdobeProofSummaryGrid"> <HeaderStyleDefault BackColor="#606060" Font-Bold="True" Font-Names="Verdana" Font-Size="10pt" ForeColor="White" HorizontalAlign="Left" VerticalAlign="Middle"> </HeaderStyleDefault> <RowStyleDefault TextOverflow="Ellipsis" VerticalAlign="Middle" BorderWidth="1px" Font-Size="8pt" Font-Names="Verdana" BorderColor="Silver" BorderStyle="Solid" HorizontalAlign="Left" ForeColor="Black" BackColor="Window"> <Padding Left="3px"></Padding> </RowStyleDefault> <SelectedRowStyleDefault ForeColor="Black" BackColor="LightSteelBlue"> </SelectedRowStyleDefault> <ActivationObject BorderColor="" BorderWidth=""> </ActivationObject> </DisplayLayout> <Bands> <igtbl:UltraGridBand> <Columns> </Columns> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> </igtbl:UltraGridBand> </Bands> </igtbl:UltraWebGrid>
In the InitializeLayout:
e.Layout.Bands[0].Columns.FromKey("Comments").Type = Infragistics.WebUI.UltraWebGrid.ColumnType.DropDownList; e.Layout.Bands[0].Columns.FromKey("Comments").EditorControlID = "CommentsSignoffCombo";
Hope this helps.
Please let me know if I am missing something somewhere!