8 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 05 May 2008, 06:27 AM
Hi,
Try the following code snippet to achieve the desired scenario.
CS:
Thanks
Shinu.
Try the following code snippet to achieve the desired scenario.
CS:
protected void Button1_Click(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
{ |
RadGrid1.MasterTableView.ClearEditItems(); |
item.OwnerTableView.IsItemInserted = false; |
} |
} |
Thanks
Shinu.
0

Vinhlan
Top achievements
Rank 1
answered on 06 May 2008, 05:47 AM
Hi Shinu,
I tried the code snippet that you provided. However, it did not work.
Thanks,
Vinhlan
I tried the code snippet that you provided. However, it did not work.
Thanks,
Vinhlan
0

Kiara
Top achievements
Rank 1
answered on 06 May 2008, 11:11 AM
Add a Rebind() method call at the bottom of the provided code snippet:
Kiara
protected void Button1_Click(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
{ |
RadGrid1.MasterTableView.ClearEditItems(); |
item.OwnerTableView.IsItemInserted = false; |
RadGrid1.MasterTableView.Rebind(); |
} |
} |
Kiara
0

Vinhlan
Top achievements
Rank 1
answered on 08 May 2008, 01:52 AM
Hi Kiara,
I've tried that too. However, it still did not work.
Thanks,
Vinhlan
I've tried that too. However, it still did not work.
Thanks,
Vinhlan
0
Hi Vinhlan,
Attached to this message, is a sample application, which handles the required functionality.
I hope it helps.
Kind regards,
Yavor
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Attached to this message, is a sample application, which handles the required functionality.
I hope it helps.
Kind regards,
Yavor
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Princy
Top achievements
Rank 2
answered on 08 May 2008, 06:03 AM
Hi Vinhlan,
You can also try the following line of code to clear the edit items on clicking the button.
CS:
Thanks
Princy.
You can also try the following line of code to clear the edit items on clicking the button.
CS:
RadGrid1.EditIndexes.Clear(); |
RadGrid1.Rebind(); |
Thanks
Princy.
0

chris
Top achievements
Rank 1
answered on 10 Feb 2009, 09:59 PM
This is old but i was looking for the same thing and everybody here has server side examples. You can also do it from JavaScript
My button
The javascript
My button
<a id="A1" href="#" runat="server" onclick="SwitchGridInInsertMode();return false;" class="newButton"> |
<span>Add</span></a> |
The javascript
function SwitchGridInInsertMode() |
{ |
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); |
masterTable.showInsertItem(); |
} |
0

Princy
Top achievements
Rank 2
answered on 13 Feb 2009, 06:19 AM
Hi Chris,
You can call the fireCommand mehod which triggers specific command for the grid when executed.
JavaScript:
or also use the insertItem() method to purt the grid in insert mode.
function AddNewItem()
{
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.insertItem();
}
Thanks
Princy
You can call the fireCommand mehod which triggers specific command for the grid when executed.
JavaScript:
<script type="text/javascript"> |
function addnew() |
{ |
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); |
masterTable.fireCommand("InitInsert",""); |
} |
</script> |
or also use the insertItem() method to purt the grid in insert mode.
function AddNewItem()
{
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.insertItem();
}
Thanks
Princy