Hi,
i am using a row template, user control. If i have a post back on the screen my row template does not show. If no post back on the screen, row template shows and works great.
any ideas.....
thank you,
UltraWebGrid1.Bands(0).RowEditTemplate = template
i put above two lines of code before Page.IsPostback; in other words template gets assigned on every postback, but i had the same result.
i tried another thing, which i need little explanation; i put Me.Databind out side the page.ispostback event, then i see the row template even after the page postback!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
why do i have to bind the controls, or even grid on every post back?
Without testing
If Not IsPostBack Then
You load the template only on the initial load of the page. I don't think the template gets put in viewstate (could be wrong) but you might want to ensure that the RowEditTemplate isn't null during the postback.
here is hte HTML or .aspx
<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v6.2, Version=6.2.20062.1045, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script id="Infragistics" type="text/javascript">
<!--
//Add code to handle your event here.
}
oRow.editRow();
// -->
</head>
<body>
<form id="form1" runat="server">
<div>
left: 179px; position: absolute; top: 14px" Width="325px">
<Bands>
<igtbl:UltraGridBand>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
<FilterOptions>
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px" Width="200px">
<Padding Left="2px" />
</FilterDropDownStyle>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
</FilterHighlightRowStyle>
</FilterOptions>
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout AllowAddNewDefault="Yes" AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer"
AllowDeleteDefault="Yes" AllowSortingDefault="OnClient" AllowUpdateDefault="RowTemplateOnly"
BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti" Name="UltraWebGrid1"
RowHeightDefault="20px" RowSelectorsDefault="No" SelectTypeRowDefault="Extended"
Version="4.00" ViewType="OutlookGroupBy">
<GroupByBox>
<Style BackColor="ActiveBorder" BorderColor="Window"></Style>
</GroupByBox>
<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
</GroupByRowStyleDefault>
<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">
<BorderDetails ColorLeft="Window" ColorTop="Window" />
<Padding Left="3px" />
</RowStyleDefault>
<FilterOptionsDefault>
</FilterOptionsDefault>
<ClientSideEvents InitializeLayoutHandler="UltraWebGrid1_InitializeLayoutHandler" ClickCellButtonHandler="UltraWebGrid1_ClickCellButtonHandler" />
<HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid" HorizontalAlign="Left">
</HeaderStyleDefault>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
</EditCellStyleDefault>
<FrameStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Height="200px"
Width="325px">
</FrameStyle>
<Pager>
<Style BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
<BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White"></BorderDetails>
</Style>
</Pager>
<AddNewBox Hidden="False">
<Style BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px">
</AddNewBox>
</DisplayLayout>
</igtbl:UltraWebGrid>
top: 295px" Text="Button" />
</div>
</body>
</html>
Here is the VB code
Imports Infragistics.WebUI.UltraWebGrid
Imports System.Drawing
Imports System.Data.OleDb
Imports WebSamplesVB.WebSamplesVB
Inherits System.Web.UI.Page
Private contactsDataSet1 As New System.Data.DataSet
End Sub
' Create the template and add to it.
' Add an extra column for a button to allow template editing
UltraWebGrid1.Columns(0).Type = ColumnType.Button
Me.UltraWebGrid1.Columns(0).CellButtonStyle.BackColor = Color.FromArgb(204, 0, 0)
Me.UltraWebGrid1.Columns(0).CellStyle.BackColor = Color.FromArgb(51, 51, 51)
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(0).Header.Caption = "Edit"
End If
oleDbConnection1 = New OleDbConnection(Config.NorthwindMDBConnString)
cmdCustomers.Fill(contactsDataSet1, "Customers")
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(1).Header.Caption = "Customer ID"
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(2).Header.Caption = "Company Name"
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(3).Header.Caption = "Contact Name"
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(4).Header.Caption = "Phone"
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(5).Header.Caption = "Address"
End Class
once the page loads i can click cell button to edit, but if i do a post back on the screen, click button(nothing on the code behind) and try to grid cell button click no template loads...
Note:
i also have user control page, but its no different than sample example row template (C:\Program Files\Infragistics\NetAdvantage 2006 Volume 2 CLR 2.0\ASP.NET\Samples\VB\WebGrid\RowTemplates\rowtemplate.ascx)
naredlaa said:any ideas.....