I'm moving to using a PopUp template for the updating of records within a RadGrid, but am unable to retrieve the updated value from my text box, it keeps returning the original value.
Below I've included a very simple grid with just the one column and the same is happening.
| <telerik:RadGrid ID="rgTestData" runat="server" AutoGenerateColumns="False" GridLines="None" |
| Skin="WebBlue" Width="600px" OnInsertCommand="rgTestData_InsertCommand" OnCancelCommand="rgTestData_CancelCommand" |
| OnUpdateCommand="rgTestData_UpdateCommand" AllowPaging="True" AutoGenerateEditColumn="True" |
| OnItemCommand="rgTestData_ItemCommand"> |
| <HeaderContextMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </HeaderContextMenu> |
| <MasterTableView CommandItemDisplay="TopAndBottom" EditMode="PopUp"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="genericName" HeaderText="Generic Name" UniqueName="genericName"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings EditFormType="Template"> |
| <EditColumn AutoPostBackOnFilter="True" UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| <FormTemplate> |
| <telerik:RadTextBox ID="txtGenericName" runat="server" Skin="WebBlue" Width="125px" |
| Text='<%# Bind("genericName") %>'> |
| </telerik:RadTextBox> |
| <br /> |
| <asp:LinkButton ID="btnSave" runat="server" Text="Save" CommandName="Update" /> |
| <asp:LinkButton ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" /> |
| </FormTemplate> |
| </EditFormSettings> |
| </MasterTableView> |
| <FilterMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |
I'm then very simply trying to pull back the new value I've entered in the textbox after the Update button is pressed.
| protected void rgTestData_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if (e.CommandName == RadGrid.UpdateCommandName) |
| { |
| if (e.Item is GridEditFormItem && e.Item.IsInEditMode) |
| { |
| GridEditableItem item = e.Item as GridEditableItem; |
| String GenericName = item["genericName"].Text.ToString(); |
| } |
| } |
| } |
Hi,
How to display telerik:gridtemplate column inside telerik:gridbound column?
or how to display the child radgrid within a parent radgrid with the gridbound column when
master table view of Table layout ="Fixed" to define its column width ?
Thanking you in advance.
Hello,
I have a grid with a DetailTable and dynamically created columns in that DetailTable. I use the ColumnCreating event to modify the HeaderTexts of the dynamic columns. When I use the standard Expand/Collapse Column everything works fine: the ExpandCommand gets fired, the DetailTable is bound and the ColumnCreating event is fired.
Now I want to automatically expand an item based on conditions that I get from a session variable (which contains the index of the item to expand) without a preceding postback. So in the PreRender Event of the RadGrid I loop through the GridDataItems and if the ItemIndex matches the index retrieved from the session variable I set item.Expanded = true. Now everything seems to work as expected but the ColumnCreating event is not fired hence I can't set the HeaderTexts of the columns.
What am I doing wrong? Expanding an item in the PreRender event only works after a postback. When it's a normal page request the ColumnCreating event isn't fired. I tried to use different events to set the expanded item but with no success.
The grid architecture is pretty complex so it's difficult to post code or a sample project.
Thanks for your help.
Best regards
Sebastian
Hi there,
I have some performance issue with the grid. The page that uses RadGrid is rendered rather quickly - but once the page is rendered and displayed, it takes the browser a few seconds of processing time before settling down.The amount of cilent side processing is most pronounced in IE6 (firefox is a few times more efficient).
Is this a known issue?
I had a quick look at the HTML and the size of embedded javascript is about 200kb. I am wondering if the browser needs to initialize / execute something when everything has been rendered - and if so what we can do to reduce the processing time.
The grid is not paged and there are about 60 items bound to it. Size of HTML for the RadGrid is a bit over 130kb.
Quick excerpt of the script:
<script type="text/javascript">
//<![CDATA[
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadGrid, {"ClientID":"ctl00_ContentPlaceHolder1_CategoryGrid","ClientSettings":{"PostBackFunction":"__doPostBack(\u0027{0}\u0027,\u0027{1}\u0027)","AllowExpandCollapse":true,"AllowGroupExpandCollapse":true,"ColumnsReorderMethod":0,"ShouldCreateRows":true,"Selecting":{"EnableDragToSelectRows":true},"Scrolling":{"SaveScrollPosition":true,"ScrollHeight":"300px"},"Resizing":{"ClipCellContentOnResize":true},"ClientMessages":{"DragToGroupOrReorder":"Drag to group or reorder","DragToResize":"Drag to resize","DropHereToReorder":"Drop here to reorder","PagerTooltipFormatString":"Page: \u003cb\u003e{0}\u003c/b\u003e out of \u003cb\u003e{1}\u003c/b\u003e pages"}},"Skin":"Outlook","UniqueID":"ctl00$ContentPlaceHolder1$CategoryGrid","_activeRowData":"","_clientKeyValues":{},"_currentPageIndex":0,"_editIndexes":"[]","_gridTableViewsData":"[{\"ClientID\":\"ctl00_ContentPlaceHolder1_CategoryGrid_ctl00\",\"UniqueID\":\"ctl00$ContentPlaceHolder1$CategoryGrid$ctl00\",\"PageSize\":10,\"PageCount\":1,\"CurrentPageIndex\":0,\"VirtualItemCount\":0,\"AllowMultiColumnSorting\":false,\"sliderClientID\":\"\",\"sliderLabelClientID\":\"\",\"Name\":\"\",\"IsItemInserted\":false,\"clientDa
.
.