hi,
I have to use webdatechooser inside webgrid.I used the following code but still i wont get datechooser on editing .Plz help me
GridColumn = new UltraGridColumn();
GridColumn.BaseColumnName = "FromDate";
GridColumn.Header.Caption = GetResString("ValidFrom.Text"); //"From Date";
GridColumn.Header.RowLayoutColumnInfo.OriginY = 0;
GridColumn.Width = Unit.Percentage(25);
GridColumn.Key = "FromDate";
igrdAccess.Bands[0].Columns.Add(GridColumn);
GridColumn.AllowUpdate = AllowUpdate.Yes;
GridColumn.Type = ColumnType.Custom;
GridColumn.EditorControlID = fromDate.UniqueID;
fromDate.DropDownStyle.BackColor = System.Drawing.Color.Blue;
GridColumn.DataType = "System.DateTime";
fromDate.Format = Infragistics.WebUI.WebSchedule.DateFormat.Short;
GridColumn.FieldLen = 10;
GridColumn.HTMLEncodeContent = true;
Thanks in Advance,
Reagan.J
This could very well be a page life-cycle problem - it really depends on where you execute this code. Please, use this code in the initialize event of the grid. Also, could you please try using fromData.ID instead of UniqueID?
I just went through all these steps and it worked great for me. Here is my setup and code:
protected void UltraWebGrid1_InitializeLayout(object sender, LayoutEventArgs e) { UltraGridColumn GridColumn = new UltraGridColumn(); GridColumn.BaseColumnName = "BirthDate"; GridColumn.Header.Caption = "Date"; GridColumn.Header.RowLayoutColumnInfo.OriginY = 0; GridColumn.Width = Unit.Percentage(25); GridColumn.Key = "BirthDate"; UltraWebGrid1.Bands[0].Columns.Add(GridColumn); GridColumn.AllowUpdate = AllowUpdate.Yes; GridColumn.Type = ColumnType.Custom; GridColumn.FieldLen = 10; GridColumn.HTMLEncodeContent = true; GridColumn.DataType = "System.DateTime"; GridColumn.EditorControlID = WebDateChooser1.ID; WebDateChooser1.DropDownStyle.BackColor = System.Drawing.Color.Blue; WebDateChooser1.Format = Infragistics.WebUI.WebSchedule.DateFormat.Short; }
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="AccessDataSource1" Height="200px" Width="325px" oninitializelayout="UltraWebGrid1_InitializeLayout"> <Bands> <igtbl:UltraGridBand> <Columns> <igtbl:UltraGridColumn BaseColumnName="FirstName" IsBound="True" Key="FirstName"> <Header Caption="FirstName"> </Header> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="LastName" IsBound="True" Key="LastName"> <Header Caption="LastName"> <RowLayoutColumnInfo OriginX="1" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="1" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="EmployeeID" DataType="System.Int32" IsBound="True" Key="EmployeeID"> <Header Caption="EmployeeID"> <RowLayoutColumnInfo OriginX="2" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="2" /> </Footer> </igtbl:UltraGridColumn> </Columns> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> </igtbl:UltraGridBand> </Bands> <DisplayLayout BorderCollapseDefault="Separate" Name="UltraWebGrid1" AllowUpdateDefault="RowTemplateOnly" RowHeightDefault="20px" Version="4.00"> <FrameStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt" Height="200px" Width="325px"> </FrameStyle> <Pager> <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" /> </PagerStyle> </Pager> <EditCellStyleDefault BorderStyle="None" BorderWidth="0px"> </EditCellStyleDefault> <HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid"> <BorderDetails ColorLeft="White" ColorTop="White" /> </HeaderStyleDefault> <RowStyleDefault BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt"> <Padding Left="3px" /> <BorderDetails ColorLeft="White" ColorTop="White" /> </RowStyleDefault> <AddNewBox> <BoxStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" /> </BoxStyle> </AddNewBox> <ActivationObject BorderColor="" BorderWidth=""> </ActivationObject> </DisplayLayout> </igtbl:UltraWebGrid> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT [FirstName], [LastName], [EmployeeID], [BirthDate] FROM [Employees]"> </asp:AccessDataSource> <igsch:WebDateChooser ID="WebDateChooser1" runat="server"> </igsch:WebDateChooser>
thaks for ur reply,
even i tried with Id instead od uniqueid i am facing same issue.\plz hekp me
i send my full code with this
<igtbl:UltraWebGrid style="LEFT: 67px; TOP: 0px" id="igrdAccess" tabIndex=1 runat="server" Browser="Xml" Width="100%" Height="160px" __designer:wfdid="w3">
<Bands>
<igtbl:UltraGridBand AllowSorting="No">
<AddNewRow View="NotSet" Visible="NotSet">
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout ScrollBarView="Vertical" AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer"
AllowDeleteDefault="Yes" BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti"
Name="igrdAccess" RowHeightDefault="20px" RowSelectorsDefault="No" SelectTypeRowDefault="Extended"
StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed"
Version="4.00" LoadOnDemand="Xml">
<GroupByBox>
<BoxStyle BackColor="ActiveBorder" BorderColor="Window">
</BoxStyle>
</GroupByBox>
<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
</GroupByRowStyleDefault>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
<FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
</FooterStyleDefault>
<RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
<BorderDetails ColorLeft="Window" ColorTop="Window" />
<Padding Left="3px" />
</RowStyleDefault>
<FilterOptionsDefault>
<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px">
<Padding Left="2px" />
</FilterOperandDropDownStyle>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
</FilterHighlightRowStyle>
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px" Height="160px" Width="200px">
</FilterDropDownStyle>
</FilterOptionsDefault>
<HeaderStyleDefault BackColor="#8CAED0" BorderStyle="Solid" HorizontalAlign="Left"
Font-Names="Arial" Font-Size="Small">
</HeaderStyleDefault>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
</EditCellStyleDefault>
<FrameStyle Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Height="150px" Width="100%"
BackColor="White">
</FrameStyle>
<AddNewBox Hidden="False">
<BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px">
</AddNewBox>
<FixedHeaderStyleDefault BackColor="#8CAED0">
</FixedHeaderStyleDefault>
<ClientSideEvents InitializeLayoutHandler="igrdAccess_InitializeLayout" />
</DisplayLayout>
</igtbl:UltraWebGrid>
{
GridColumn.EditorControlID = fromDate.ID;
}
In cases like that and especially urgent ones I believe the fastest and best approach is to contact our Dedicated Developer Support team directly via this link:
http://devcenter.infragistics.com/Protected/SubmitSupportIssue.aspx
If you can prepare a small working subset of your project reproducing the exact issue, plus some environment details like NetAdvantage version, VS.NET / ASP.NET Version, Browsers, etc this will help us in providing a solution / hotfix / additional information.
This is generally a peer to peer forum and while we do try to help as much as we can, in urgent cases where a lot of information is needed, this is the better venue. Thanks for the understanding.