Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Eval after a postback not re-evaluated
posted


HI,

I have a strange issue.

I have a "eval" function in my webdatagrid to fulfill the title property of an image with the property of my DataRow(column : SAVEDSTATE)

At the first page load, it's ok eval is well execute. I modify the cell in column col2 and click on a button to save the modification.

In the save method : if the modification isn't properly saved, I set the RowError with a message. But when the webdatagrid is display, the eval isn’t reevaluated.

If I create another postback with another button (it does nothing), the eval is reevaluated.

I could send you my test project.

A part of my webdatagrid

<Columns>
                    <ig:TemplateDataField Key="SAVEDSTATE">
                        <ItemTemplate>
                            <img src="../../../Images/wrong.png" title="<%#DataBinder.Eval(((System.Data.DataRowView)((Infragistics.Web.UI.TemplateContainer)Container).DataItem).Row, "RowError")%>"
                                alt="Save KO" />
                        </ItemTemplate>
                        <Header Text="Saved status" />
                    </ig:TemplateDataField>
                    <ig:BoundDataField DataFieldName="col1" Key="col1" Width="60px">
                        <Header Text="col1" />
                    </ig:BoundDataField>
                    <ig:BoundDataField DataFieldName="col2" Key="col2" Width="100px">
                        <Header Text="col2" />
                    </ig:BoundDataField>
                </Columns>
........
save button
protected void ibSave_Click(object sender, ImageClickEventArgs e)
        {
            DataTable dt = (DataTable)wgrid.DataSource;
            List<DataRow> ModifiedRows = dt.AsEnumerable().Where<DataRow>(d => d.RowState == DataRowState.Modified).ToList<DataRow>();
            foreach (DataRow ItemRow in dt.Rows)
            {
                try
                {
                    //Save method
                }
                catch (Exception)
                {
                    ItemRow.RowError = "julien";
                }
                
            }
        }
any idea?
Thanks
Parents Reply Children
No Data