Hi,
I'm trying to put a webdatechooser inside my ultrawebgrid. I have taken a look at the samples- date chooser in cell, date chooser in user control- posted online, but they are in javascript.
Also, I have searched this site for an answer, but none of them seem to be current. http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=6150
I know someone has to know how to do this. Please lend me a hand.
Thanks
Jg
I was able to add the datechooser at runtime following the code in the example above, but when i select a date it does a postback and changes the grid colors. I do not want it to do a postback after selecting a date. How do i set this in code at runtime?
using vb.net and added these lines of code:
'Associate WebDateChooser to the column
UltraWebGrid1.Columns(0).EditorControlID = WebDateChooser1.UniqueID
UltraWebGrid1.Columns(0).Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom
'Set the AllowUpdate Property
UltraWebGrid1.Columns(0).AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes
Vince,
The EditControlID property did it for me. Thanks.
~Jg
Jg,
At a quick glance, here's something that jumps out at me:
jillhuddleston said:<igsch:WebDateChooser ID="WebDateChooser1" runat="server"></igsch:WebDateChooser>
jillhuddleston said:<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Date_of_Rank"DataType="System.DateTime" IsBound="True" Key="Date_of_Rank" Type="Custom"><Header Caption="Date_of_Rank"></Header></igtbl:UltraGridColumn>
Also,
jillhuddleston said:The only thing problem I encountered with them is Step #6: Set the DisplayLayout.AddNewBox.Hidden property to "false" so we can add rows to the Grid. I could not find this property in the Quick Designer, so I just left that part out.
I could not find this property in the Quick Designer, so I just left that part out.
jillhuddleston said:<AddNewBox Hidden="False"><BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px"><BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /></BoxStyle></AddNewBox>
I have applied the code in the KB article to the letter, and written my findings:
Okay, so the runtime example using the code-behind still works for version 9.2....... Touche.
Thanks,
Thatnks for replying so promptly Vince.
I have followed the step-by-step directions for "NetAdvantage 2004 Volume 3 and later" in the Knowledge Base article, to the letter. Here is my markup:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="KB06150.aspx.vb" Inherits="KB06150" %> <%@ Register assembly="Infragistics35.WebUI.WebDateChooser.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebSchedule" tagprefix="igsch" %> <%@ Register assembly="Infragistics35.WebUI.UltraWebGrid.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <igsch:WebDateChooser ID="WebDateChooser1" runat="server"> </igsch:WebDateChooser> <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="workds" Height="200px" Width="325px"> <Bands> <igtbl:UltraGridBand> <Columns> <igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Date_of_Rank" DataType="System.DateTime" IsBound="True" Key="Date_of_Rank" Type="Custom"> <Header Caption="Date_of_Rank"> </Header> </igtbl:UltraGridColumn> </Columns> <AddNewRow View="NotSet" Visible="NotSet"> </AddNewRow> </igtbl:UltraGridBand> </Bands> <DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowDeleteDefault="Yes" AllowSortingDefault="OnClient" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti" Name="UltraWebGrid1" RowHeightDefault="20px" RowSelectorsDefault="No" SelectTypeRowDefault="Extended" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" ViewType="OutlookGroupBy"> <FrameStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Height="200px" Width="325px"> </FrameStyle> <Pager MinimumPagesForDisplay="2"> <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </PagerStyle> </Pager> <EditCellStyleDefault BorderStyle="None" BorderWidth="0px"> </EditCellStyleDefault> <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </FooterStyleDefault> <HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid" HorizontalAlign="Left"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </HeaderStyleDefault> <RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt"> <Padding Left="3px" /> <BorderDetails ColorLeft="Window" ColorTop="Window" /> </RowStyleDefault> <GroupByRowStyleDefault BackColor="Control" BorderColor="Window"> </GroupByRowStyleDefault> <GroupByBox> <BoxStyle BackColor="ActiveBorder" BorderColor="Window"> </BoxStyle> </GroupByBox> <AddNewBox Hidden="False"> <BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </BoxStyle> </AddNewBox> <ActivationObject BorderColor="" BorderWidth=""> </ActivationObject> <FilterOptionsDefault> <FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px" Height="300px" Width="200px"> <Padding Left="2px" /> </FilterDropDownStyle> <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White"> </FilterHighlightRowStyle> <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> </FilterOptionsDefault> </DisplayLayout> </igtbl:UltraWebGrid> <asp:SqlDataSource ID="workds" runat="server" ConnectionString="<%$ ConnectionStrings:FCCConnectionString %>" ProviderName="<%$ ConnectionStrings:FCCConnectionString.ProviderName %>" SelectCommand="SELECT tblPersonal.Date_of_Rank FROM (tblPersonal INNER JOIN tblFCCCrosswalk ON tblFCCCrosswalk.Emp_ID = tblPersonal.Emp_ID) WHERE (tblFCCCrosswalk.Emp_ID = ?)" UpdateCommand="UPDATE tblPersonal SET Street_Address = @Street_Address, City = @City, State = @State, Zip = @Zip, Phone = @Phone, Pay_Grade = @Pay_Grade, Date_of_Rank = @Date_of_Rank, Scale = @Scale, Step = @Step WHERE Emp_ID = ?"> <SelectParameters> <asp:QueryStringParameter Name="Emp_ID" QueryStringField="EmployeeID" Type="Double" /> </SelectParameters> </asp:SqlDataSource> </div> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="KB06150.aspx.vb" Inherits="KB06150" %>
<%@ Register assembly="Infragistics35.WebUI.WebDateChooser.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebSchedule" tagprefix="igsch" %>
<%@ Register assembly="Infragistics35.WebUI.UltraWebGrid.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<igsch:WebDateChooser ID="WebDateChooser1" runat="server">
</igsch:WebDateChooser>
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="workds"
Height="200px" Width="325px">
<Bands>
<igtbl:UltraGridBand>
<Columns>
<igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Date_of_Rank"
DataType="System.DateTime" IsBound="True" Key="Date_of_Rank" Type="Custom">
<Header Caption="Date_of_Rank">
</Header>
</igtbl:UltraGridColumn>
</Columns>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer"
AllowDeleteDefault="Yes" AllowSortingDefault="OnClient"
AllowUpdateDefault="Yes" BorderCollapseDefault="Separate"
HeaderClickActionDefault="SortMulti" Name="UltraWebGrid1"
RowHeightDefault="20px" RowSelectorsDefault="No"
SelectTypeRowDefault="Extended" StationaryMargins="Header"
StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00"
ViewType="OutlookGroupBy">
<FrameStyle BackColor="Window" BorderColor="InactiveCaption"
BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif"
Font-Size="8.25pt" Height="200px" Width="325px">
</FrameStyle>
<Pager MinimumPagesForDisplay="2">
<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
WidthTop="1px" />
</PagerStyle>
</Pager>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
</EditCellStyleDefault>
<FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
</FooterStyleDefault>
<HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid"
HorizontalAlign="Left">
</HeaderStyleDefault>
<RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
<Padding Left="3px" />
<BorderDetails ColorLeft="Window" ColorTop="Window" />
</RowStyleDefault>
<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
</GroupByRowStyleDefault>
<GroupByBox>
<BoxStyle BackColor="ActiveBorder" BorderColor="Window">
</BoxStyle>
</GroupByBox>
<AddNewBox Hidden="False">
<BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
BorderWidth="1px">
</AddNewBox>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
<FilterOptionsDefault>
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" CustomRules="overflow:auto;"
Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px" Height="300px"
Width="200px">
<Padding Left="2px" />
</FilterDropDownStyle>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
</FilterHighlightRowStyle>
<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver"
BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;"
Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px">
</FilterOperandDropDownStyle>
</FilterOptionsDefault>
</DisplayLayout>
</igtbl:UltraWebGrid>
<asp:SqlDataSource ID="workds" runat="server"
ConnectionString="<%$ ConnectionStrings:FCCConnectionString %>"
ProviderName="<%$ ConnectionStrings:FCCConnectionString.ProviderName %>"
SelectCommand="SELECT tblPersonal.Date_of_Rank FROM (tblPersonal INNER JOIN tblFCCCrosswalk ON tblFCCCrosswalk.Emp_ID = tblPersonal.Emp_ID) WHERE (tblFCCCrosswalk.Emp_ID = ?)" UpdateCommand="UPDATE tblPersonal
SET Street_Address = @Street_Address,
City = @City,
State = @State,
Zip = @Zip,
Phone = @Phone,
Pay_Grade = @Pay_Grade,
Date_of_Rank = @Date_of_Rank,
Scale = @Scale,
Step = @Step
WHERE Emp_ID = ?">
<SelectParameters>
<asp:QueryStringParameter Name="Emp_ID" QueryStringField="EmployeeID" Type="Double" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
The only thing problem I encountered with them is Step #6: Set the DisplayLayout.AddNewBox.Hidden property to "false" so we can add rows to the Grid.
When I ran my code, I can see the bound datetime value in my ultrawebgrid, and above it, an instance of a datechooser control, however when I try to edit the value in my ultrawebgrid, it turns to a textbox, not the datechooser control
I will try the At Runtime method and report back, but in the meantime, any suggestions would be appreciated.