Posted 19 hours ago (permalink)
Hi,
I've been looking for the demo application given on the url:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid
A snippet for that demo:
And I could not understand what form element or event fires the function
I think, It should be called in the onClientClose() of the radwindow.Does the given sample code has some missed parts?
I am trying to run that sample on Sitefinity. But I could not yet.
Shortly the code that I use:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowEditForm(id, rowIndex) {
window.radopen("UserControls/Pages/PaketKapsaminaAlma.aspx?IstId=" + id, "UserListDialog");
return false;
}
function ShowInsertForm() {
window.radopen("UserControls/Pages/PaketKapsaminaAlma.aspx", "UserListDialog");
return false;
}
function refreshGrid(arg) {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
function RowDblClick(sender, eventArgs) {
window.radopen("UserControls/Pages/Istek.PaketKapsaminaAlma?IstId=" + eventArgs.getDataKeyValue("ISTID"), "UserListDialog");
}
</script>
</telerik:RadCodeBlock>
and I call the function refreshGrid(arg) on OnClientClose of RadWindow with ID UserListDialog
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Title="Paket kapsamına alma" Height="300px"
Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" OnClientClose="refreshGrid"
Modal="true" />
</Windows>
</telerik:RadWindowManager>
my AjaxRequest function on cs file is:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
BindMyGrid();//this is my function to bind the grid
// rdgvIstektenAramaSonuclari.MasterTableView.SortExpressions.Clear();
//rdgvIstektenAramaSonuclari.MasterTableView.GroupByExpressions.Clear();
//rdgvIstektenAramaSonuclari.Rebind();
}
}
When I used the recomended lines below there were no action
// rdgvIstektenAramaSonuclari.MasterTableView.SortExpressions.Clear();
//rdgvIstektenAramaSonuclari.MasterTableView.GroupByExpressions.Clear();
//rdgvIstektenAramaSonuclari.Rebind();
It works great with my BindMyGrid() function which binds the grid with the related datasource of mine. But it works only once :( .
When I click the linkbutoton on the grid that opens radwindow no problem with it. And when I close the radwindow, it refreshs the grid perfectly..:) And I push the similar linkbutton on the grid to open the radwindow . And no problem again. But when I update the data belong to grid and close the radwindow, it says that:
Microsoft JScript runtime error: 'null' is null or not an object
the problem is on the
function refreshGrid(arg) {
$find("ctl00_cntUst_ctl00_RadAjaxManager1").ajaxRequest();
}
code can't find the object for the second onclientclose event of the radwindow. I've looked everywhere on the forums related with that topic. But I have no solution yet.
I think the solution is using a Radajaxmanager on masterpage. But in that case I should reach the radgrid on the user control.
How can I reference a radgrid on a user control from a masterpage in sitefinity.
Any idea?
Regards
I've been looking for the demo application given on the url:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid
A snippet for that demo:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowEditForm(id, rowIndex)
{
var grid = $find("<%= RadGrid1.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
window.radopen("EditFormCS.aspx?EmployeeID=" + id, "UserListDialog");
return false;
}
function ShowInsertForm()
{
window.radopen("EditFormCS.aspx", "UserListDialog");
return false;
}
function refreshGrid(arg)
{
if(!arg)
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
else
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
function RowDblClick(sender, eventArgs)
{
window.radopen("EditFormCS.aspx?EmployeeID=" + eventArgs.getDataKeyValue("EmployeeID"), "UserListDialog");
}
</script>
</telerik:RadCodeBlock>
And I could not understand what form element or event fires the function
function refreshGrid(arg)
I think, It should be called in the onClientClose() of the radwindow.Does the given sample code has some missed parts?
I am trying to run that sample on Sitefinity. But I could not yet.
Shortly the code that I use:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowEditForm(id, rowIndex) {
window.radopen("UserControls/Pages/PaketKapsaminaAlma.aspx?IstId=" + id, "UserListDialog");
return false;
}
function ShowInsertForm() {
window.radopen("UserControls/Pages/PaketKapsaminaAlma.aspx", "UserListDialog");
return false;
}
function refreshGrid(arg) {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
function RowDblClick(sender, eventArgs) {
window.radopen("UserControls/Pages/Istek.PaketKapsaminaAlma?IstId=" + eventArgs.getDataKeyValue("ISTID"), "UserListDialog");
}
</script>
</telerik:RadCodeBlock>
and I call the function refreshGrid(arg) on OnClientClose of RadWindow with ID UserListDialog
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Title="Paket kapsamına alma" Height="300px"
Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" OnClientClose="refreshGrid"
Modal="true" />
</Windows>
</telerik:RadWindowManager>
my AjaxRequest function on cs file is:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
BindMyGrid();//this is my function to bind the grid
// rdgvIstektenAramaSonuclari.MasterTableView.SortExpressions.Clear();
//rdgvIstektenAramaSonuclari.MasterTableView.GroupByExpressions.Clear();
//rdgvIstektenAramaSonuclari.Rebind();
}
}
When I used the recomended lines below there were no action
// rdgvIstektenAramaSonuclari.MasterTableView.SortExpressions.Clear();
//rdgvIstektenAramaSonuclari.MasterTableView.GroupByExpressions.Clear();
//rdgvIstektenAramaSonuclari.Rebind();
It works great with my BindMyGrid() function which binds the grid with the related datasource of mine. But it works only once :( .
When I click the linkbutoton on the grid that opens radwindow no problem with it. And when I close the radwindow, it refreshs the grid perfectly..:) And I push the similar linkbutton on the grid to open the radwindow . And no problem again. But when I update the data belong to grid and close the radwindow, it says that:
Microsoft JScript runtime error: 'null' is null or not an object
the problem is on the
function refreshGrid(arg) {
$find("ctl00_cntUst_ctl00_RadAjaxManager1").ajaxRequest();
}
code can't find the object for the second onclientclose event of the radwindow. I've looked everywhere on the forums related with that topic. But I have no solution yet.
I think the solution is using a Radajaxmanager on masterpage. But in that case I should reach the radgrid on the user control.
How can I reference a radgrid on a user control from a masterpage in sitefinity.
Any idea?
Regards