This is a migrated thread and some comments may be shown as answers.

binded records are clear on radbutton click

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 16 Aug 2011, 09:58 AM

hello every one ,

in my radgrid i bind empty row on in place.
When i click radbutton values are assign in that empty here 't assign ,
But My Problem is next time i click the radbutton befre assign value are clear in radgrid 

please refer the attachment below.

<telerik:GridTemplateColumn HeaderText="Service Provider">
                                <ItemTemplate>
                                    <telerik:RadTextBox ID="serviceprod" runat="server" Width="100px">
                                    </telerik:RadTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>


this my radbutton click assigned values


Label sno = (Label)RadGrid1.Items[hiddenval.Text].FindControl("Sno");
            int val = Convert.ToInt32(sno.Text);
            int val1 = val - 1;
            if (val1 == Convert.ToInt32(hiddenval.Text))
            {
                RadTextBox serviceprod2 = (RadTextBox)RadGrid1.Items[hiddenval.Text].FindControl("serviceprod");
                RadDateInput subrecdate2 = (RadDateInput)RadGrid1.Items[hiddenval.Text].FindControl("subrecdate");
 
                serviceprod2.Text = Servprod.Text;
                subrecdate2.SelectedDate = RecdDate.SelectedDate;
                hiddenval.Text = Convert.ToString(Convert.ToInt32(hiddenval.Text) + 1);
            }

Regards,
Mohamed,

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 19 Aug 2011, 08:28 AM
Hello Mohamed,

In order to persists fields values into the RadGrid after postback (when the RadButton is clicked second time and the source fields are empty) you need to change the data source to which the RadGrid is bound when the button is clicked for the first time.
I am sending you a simple example which demonstrates this, please check it out and let me know if it helps you.

Looking forward for your reply.

Regards,
Radoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
mohamed
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or