We use a UltraWebGrid to create a custom server control. This grid is editable and the properties of DisplayLayout.AllowUpdateDefault, Column.AllowUpdate, and Cells.AllowEditing is enabled. However, none of the grid cell is editable. What could be the problem?
I'm glad to help.
With your additional description, I agree that this is likely the cause of this behavior. Data will be rendered in a situation like this. Formatting may or may not be, depending on what approach you're using to format the grid (CSS is more likely to work than setting the grid's various Style properties in this scenario). It sounds like you'll need to render the appropriate JavaScript tags for the grid to become functional.
Thanks for the explaination and I think that is the problem.
We have a page which unload a control and load this UltraWebGrid custom server control dynamically in responding to a page event using ajax. The Page does not go through the full life cycle when displaying this customer server control. That was the reason why the whole grid becomes read only. The data and format is renderd without any problems, though.
anwang168 said:We use a UltraWebGrid to create a custom server control.
Can you provide more detail as to how you're including WebGrid in your custom server control?
If you're emitting the HTML of the grid to your control, it's possible that you might not also be accounting for the JavaScript files used by the control. This would cause the grid to be nearly totally non-responsive, since our client-side object model would not have been loaded. You would need to emit the necessary script tags to the page yourself in this case, including the JavaScript call to igtbl_initGrid() to initialize the grid when the page completes rendering on the client.
If you're using some other approach, we'll need more information as to what you're doing.
Hi,
I'm the new user of this control,and I met this problem too,I wish these two methods can help you.
1.using following codes to create UltraWebGrid control,and the grid cell can be edited:
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Height="236px" Width="899px" > <Bands> <igtbl:UltraGridBand> <AddNewRow View="Bottom" Visible="Yes"> </AddNewRow> </igtbl:UltraGridBand> </Bands> <DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowDeleteDefault="Yes" AllowSortingDefault="OnClient" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti" Name="ctl00xUltraWebGrid1" 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="236px" Width="899px"> </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 Hidden="True"> <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:Panel>
2.If you just want some cells can be edited,you can use this method(C#):
UltraWebGrid.Rows[i].Cells[i].AllowEditing = AllowEditing.Yes;