Hello everybody!
This is how I have defined grid in aspx page:
I hope some can help me. I have all the grid items in Edit mode. Edit mode is done like this;
I read Values from grid like this:
If I change some values in grid, and try to read it.I get always old value. I give you exsample.If Item orginal information is like this:
Unit:kg
Info:Plah
Quantity:4
And I change item information to
Unit:kg
Info:Plah2
Quantity:5555
If I put break point in CollectRowInformation and check values,It always show orginal values.How Can i read new values from grid.
This is how I have defined grid in aspx page:
<MasterTableView EditMode="InPlace" EnableViewState="False"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn DataField="PurchaseRecommendationLineID" UniqueName="PurchaseRecommendationLineID" Visible="false"/> |
<telerik:GridTemplateColumn UniqueName="Product" DataField="Product" HeaderText="Tuote" > |
<EditItemTemplate> |
<asp:TextBox ID="Text" runat="server" Text='<%#Bind("Product") %> '/> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridBoundColumn DataField="Unit" UniqueName="Unit" HeaderText="Yksikkö"/> |
<telerik:GridNumericColumn DataField="Quantity" UniqueName="Quantity" HeaderText="Määrä" HeaderStyle-Width="50px" NumericType="Number"/> |
<telerik:GridBoundColumn DataField="Info" UniqueName="Info" HeaderText="Info"/> |
</Columns> |
I hope some can help me. I have all the grid items in Edit mode. Edit mode is done like this;
protected void ProposalGrid_PreRender(object sender, EventArgs e) |
{ |
if (!IsPostBack || forceEditable) |
{ |
forceEditable = false; |
foreach (GridItem item in ProposalGrid.MasterTableView.Items) |
{ |
if (item is GridEditableItem) |
{ |
GridEditableItem editableItem = item as GridDataItem; |
editableItem.Edit = true; |
} |
} |
} |
ProposalGrid.Rebind(); |
} |
I read Values from grid like this:
private void CollectRowInformation(int headerid) |
{ |
foreach (GridDataItem item in ProposalGrid.MasterTableView.Items) |
{ |
RowObject ro = new RowObject(); |
ro.Rowdata.Add("Unit", item["Unit"].Text); |
ro.Rowdata.Add("Info", item["Info"].Text); |
ro.Rowdata.Add("Quantity", item["Quantity"].Text); |
ProsalService.Persist(ro); |
} |
} |
Unit:kg
Info:Plah
Quantity:4
And I change item information to
Unit:kg
Info:Plah2
Quantity:5555
If I put break point in CollectRowInformation and check values,It always show orginal values.How Can i read new values from grid.