Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
215 views

I have a need similar to this one:
http://www.telerik.com/community/forums/aspnet-ajax/grid/set-customfiltercolumn-currentfilterfunction.aspx

I have a grid with filter columns using the default options (less a few I deleted in code behind).
Suppose the user selects a filter option such as "greater than".  Afterward, if the user clears the filter box and then clicks the filter button, the user expects to invoke the "no filter" option.  But it does not work.  Instead the user must click the "no filter" option.
How can we cause the "no filter" option to be invoked if the user clears the filter box and then clicks the filter button?

Steve

John Davis
Top achievements
Rank 2
 answered on 11 Jun 2010
1 answer
104 views
Hello,

I'm using the client-side programmatic binding feature with the Telerik rad grid control, and I also have <ClientSettings EnablePostBackOnRowClick="True".  The Grid causes the postback, and the following form values are present:

__EVENTTARGET: <correct grid id>
__EVENTARGUMENT: RowClick$<index>

So that's correct, but the ItemCommand event does not fire... any idea why?

Thanks.
Nikolay Rusev
Telerik team
 answered on 11 Jun 2010
1 answer
66 views
how can I do this but using a boundfield and on the client side so no postbacks are needed?
subtotals in footer on client using templates
i'm trying to especially stay away from template fields in my radgrid

actually i need it for gridnumericcolumn not boundcolumn
Yavor
Telerik team
 answered on 11 Jun 2010
2 answers
176 views

I have a situation where depending on other controls on the page, I want to hide or show two different columns in a RadGrid. Unfortunately, I'm having trouble getting this to work.

The grid is being bound client-side to an ASP.NET AJAX web service. When the grid is being databound (i.e. in its ClientEvents-OnDataBinding event or in its ClientEvents-OnDataBound event [I've tried both, same results]) I use a loop like the following to hide or show the appropriate column: 

    var view = g_grdProjects.get_masterTableView();  
    for (var i = 0; i < view.get_columns().length; ++i)  
    {  
        if (view.get_columns()[i].get_uniqueName() == "Project.ProjectStageDate")  
        {  
            if (projectType == 'Closed')  
                view.showColumn(i);  
            else 
                view.hideColumn(i);  
        }  
        if (view.get_columns()[i].get_uniqueName() == "Project.Stage")  
        {  
            if (projectType == 'Closed')  
                view.hideColumn(i);  
            else 
                view.showColumn(i);  
        }  
    }  
 
 

This works as expected; however, when I use this code, posting back the page (which is required at some points) results in the following error:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadGrid.LoadClientState(Dictionary`2 clientState) +4232
   Telerik.Web.UI.RadCompositeDataBoundControl.LoadPostData(String postDataKey, NameValueCollection postCollection) +149
   Telerik.Web.UI.RadCompositeDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +13
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +8905944
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +878

 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

I've tried replacing the calls to showColumn and hideColumn with calls to the column's set_visible() method instead; that resolves the postback issue but results in incorrect behavior (the columns hide fine, but calling set_visible(true) does not show the columns, so they remain hidden forever).

Is there a way to use showColumn()/hideColumn() and keep the ability to post back when necessary?

Yavor
Telerik team
 answered on 11 Jun 2010
3 answers
463 views
I have a grid, and I have the OnColumnResized client event wired up.  My problem is that it appears to be firing way too much.  I expected this to fire after the column is done being resized, but it appears to fire continuously, identical to the behavior of OnColumnResizing.

Here is my javascript function:
<script language="javascript" type="text/javascript"
function ColumnResized(sender, eventArgs) 
    var columnIndex = eventArgs.get_gridColumn().get_element().cellIndex; 
    var newWidth = eventArgs.get_gridColumn().get_element().offsetWidth; 
     
    $("#<%= txtIndex.ClientID %>").val(columnIndex); 
    $("#<%= txtWidth.ClientID %>").val(newWidth); 
</script> 
 
All I am doing at this point is updating some textboxes with jQuery after the event.  Here is my grid definition:
<telerik:RadGrid ID="radGrid" runat="server" ShowHeader="true" Width="100%" GridLines="Both"
          <ClientSettings> 
              <Resizing AllowColumnResize="true" AllowRowResize="false" ResizeGridOnColumnResize="false" EnableRealTimeResize="true" /> 
              <ClientEvents OnColumnResized="ColumnResized" OnColumnResizing="ColumnResizing" /> 
          </ClientSettings> 
          <HeaderStyle HorizontalAlign="center" /> 
          <ItemStyle HorizontalAlign="center" /> 
</telerik:RadGrid> 

The columns are being set up in the code-behind.  When I run this, The textboxes constantly update as I am resizing the column, where I expected the value to update only once, when I stop dragging the column.  Can anyone tell me why this is happening?
Rosen
Telerik team
 answered on 11 Jun 2010
4 answers
400 views
I have the following RadComboBox bound to a list of US States

  <telerik:RadComboBox 
       ID="ddlPropertyState" 
       Runat="server" 
       Skin="Windows7"  
       Width="140px"
       AutoPostBack="true" 
       AllowCustomText="true"
       EmptyMessage="Choose..." 
       MarkFirstMatch="true" 
       EnableTextSelection ="true" 
       onselectedindexchanged="ddlPropertyState_SelectedIndexChanged1"
     >
     </telerik:RadComboBox>

The state names represent the full state names (i.e. New York).  When I type New, I get New Hampshire selected (due to alphabetical order), however hitting the space bar has no effect (i.e. I can't type New<space>York).  Is there a problem in my configuration that prevents me from doing that?

Thanks,
Nathan
Steven Hong
Top achievements
Rank 1
 answered on 11 Jun 2010
1 answer
299 views
Hi,

I have created a radgrid that uses an editformtemplate to allow for inserts and updates to data. We are using our own code to insert data into the database and to update the data in the database. In the formtemplate we have the update button being set to different commands based on the container. We also have a cancel button in the form.

If the user is editing a record and presses the cancel button the screen will refresh and the form is gone leaving only the grid. If the user is creating a record and presses the cancel button the screen will refreash but the form is still present on the screen. Here is the code we are currently using in the itemcommand event of the radgrid:

 

protected void rgFormFields_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 

{

 

if (e.CommandName == "Cancel")

 

{

e.Canceled =

true;

 

rgFormFields.MasterTableView.ClearEditItems();

rgFormFields.Rebind();

}

 

else if (e.CommandName == "Update")

 

{

Update(e);

e.Canceled =

true;

 

rgFormFields.MasterTableView.ClearEditItems();

rgFormFields.Rebind();

}

 

else if (e.CommandName == "PerformInsert")

 

{

 

//bAddNewFormField_Click(source, e);

 

Insert(e);

e.Canceled =

true;

 

rgFormFields.MasterTableView.ClearEditItems();

rgFormFields.Rebind();

}

}

Anyhelp would be greatly appreciated.
Thanks,
Jonathan

Shinu
Top achievements
Rank 2
 answered on 11 Jun 2010
2 answers
66 views
I have a user control that incorporates a splitter with two panes. In one of the pages where I use it, I'd like for the left pane (rsz_column) to be closed, so in my Page_Load method I have the following:

rsz_column.DockedPaneId = ""

This works just fine--the page renders with the panel closed. However, my splitter is rendred with a 250-pixel wide margin on the left side of the page where the pane used to be. What can I do to get the splitter to resize the right pane so there isn't that gap on the left?

Thanks!

Bryan


bdrennen
Top achievements
Rank 1
 answered on 10 Jun 2010
5 answers
97 views
I want to use args.set_cancel(true) in the javascript of the ClientDoubleClick event but that method doesn't seem to be available on the args variable for ClientDoubleClick.

Any thoughts?

Thanks,
Kevin
Nikolay Tsenkov
Telerik team
 answered on 10 Jun 2010
1 answer
110 views
I have two grids and I want to drag nth row grid 1 to mth row of grid 2. Both have different data source and so UI is different.
I select a row from left grid 1 (ID=1000) and go to the right grid 2 row and drop on particular row (ID=333). The row where I drop it I should be able to insert a row in the database saying 1000 is associated with 333.

Any ideas on how to do this?
Sanjay Singh
Top achievements
Rank 1
 answered on 10 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?