Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
145 views

Telerik Team,

I am using telerik grid in my application.

When the filter for the grid is shown on when I check the display filter checkbox and I click on Add New Record  or Edit the Record then I get the following error stated below.

Line: 6

Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

My code is as below

<body>
    <form id="form1" runat="server">
     <telerik:RadScriptManager ID="ScriptManager" runat="server" />
       <fieldset class="configureFieldsetClass">
                                <legend>Grid</legend>
                                    
                                  <table class="configureTableClass">
                                    <tr>
                                        <td align="right">
                                            <asp:CheckBox ID="CheckBox1" Text="Display Filter" runat="server" OnCheckedChanged="displayfilter_checkchanged"
                                                AutoPostBack="true" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadGrid ID="dgGrid" runat="server" AllowSorting="True" FilterItemStyle-HorizontalAlign="Center"
                                                AllowFilteringByColumn="false" AllowPaging="true" PageSize="10" AutoGenerateColumns="false"
                                                AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                                                OnNeedDataSource="dgGrid_NeedDataSource" OnInsertCommand="dgGrid_ItemInserted"
                                                OnUpdateCommand="dgGrid_ItemInserted" OnDeleteCommand="dgGrid_ItemInserted">
                                                <GroupHeaderItemStyle></GroupHeaderItemStyle>
                                                <FilterMenu>
                                                </FilterMenu>
                                                <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                                                <MasterTableView BorderWidth="0" ShowFooter="False" EditMode="InPlace" GridLines="Both"
                                                    Font-Names="Arial" CommandItemDisplay="top" AutoGenerateColumns="false" InsertItemDisplay="Bottom"
                                                    DataKeyNames="PARAM_GRID_ITEM_ID" CommandItemSettings-ShowRefreshButton="false"
                                                    CommandItemSettings-AddNewRecordText="Add New Record">
                                                    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
                                                    <RowIndicatorColumn Visible="False" UniqueName="RowIndicator">
                                                        <HeaderStyle></HeaderStyle>
                                                        <ItemStyle></ItemStyle>
                                                    </RowIndicatorColumn>
                                                    <Columns>
                                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="Images/Edit.jpg"
                                                            ItemStyle-Wrap="true" HeaderStyle-Width="8%">
                                                        </telerik:GridEditCommandColumn>
                                                        <telerik:GridBoundColumn UniqueName="COLUMN_NAME" SortExpression="COLUMN_NAME" HeaderText="Column"
                                                            DataField="COLUMN_NAME" DataType="System.String" HeaderStyle-Width="20%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="CAPTION_NAME" SortExpression="CAPTION_NAME" HeaderText="Caption"
                                                            DataField="CAPTION_NAME" DataType="System.String" HeaderStyle-Width="25%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridNumericColumn UniqueName="COLUMN_ORDER" SortExpression="COLUMN_ORDER" HeaderText="Column Order"
                                                            DataField="COLUMN_ORDER" HeaderStyle-Width="23%">
                                                        </telerik:GridNumericColumn>
                                                        <telerik:GridDropDownColumn HeaderText="Data Type" UniqueName="PARAM_TYPE_ID" DataField="PARAM_TYPE_ID"
                                                            ListTextField="PARAM_TYPE" ListValueField="PARAM_TYPE_ID" DataSourceID="DsDataType"
                                                            SortExpression="PARAM_TYPE_ID" HeaderStyle-Width="20%">
                                                        </telerik:GridDropDownColumn>
                                                        <telerik:GridBoundColumn UniqueName="PARAM_GRID_ID" SortExpression="PARAM_GRID_ID" HeaderText="PARAM_GRID_ID"
                                                            DataField="PARAM_GRID_ID" DataType="System.String" Display="false" HeaderStyle-Width="1%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="PARAM_GRID_ITEM_ID" SortExpression="PARAM_GRID_ITEM_ID"
                                                            HeaderText="PARAM_GRID_ITEM_ID" DataField="PARAM_GRID_ITEM_ID" DataType="System.String"
                                                            Display="false" HeaderStyle-Width="1%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                                            ItemStyle-HorizontalAlign="Center" UniqueName="DeleteColumn" HeaderStyle-Width="5%"
                                                            ConfirmText="Confirm that you want to delete the record?" ImageUrl="Images/Delete1.gif"
                                                            ConfirmTitle="Delete ?">
                                                        </telerik:GridButtonColumn>
                                                    </Columns>
                                                    <EditFormSettings>
                                                        <EditColumn ButtonType="ImageButton" HeaderStyle-Width="50px" />
                                                    </EditFormSettings>
                                                </MasterTableView>
                                                <HeaderStyle></HeaderStyle>
                                                <SelectedItemStyle></SelectedItemStyle>
                                                <ItemStyle VerticalAlign="Top"></ItemStyle>
                                                <FooterStyle></FooterStyle>
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <ClientSettings EnableRowHoverStyle="true">
                                                    <ClientEvents OnRowMouseOver="RowMouseOver" OnCommand="OnCommand" OnRowMouseOut="RowMouseOut" />
                                                    <Selecting AllowRowSelect="True"></Selecting>
                                                    <Resizing AllowRowResize="true" EnableRealTimeResize="false" ResizeGridOnColumnResize="false"
                                                        AllowColumnResize="false"></Resizing>
                                                </ClientSettings>
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                </table>
                              
                            </fieldset>
    </form>
</body>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using eControls;
using System.Data;
using eDataAccess;
using SRSBO;
using eBusinessObjects;
using System.Text.RegularExpressions;
 
public partial class Demo : System.Web.UI.Page
{
    public int NodeId = -1;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!(int.TryParse(Request.QueryString["NODEID"], out NodeId)))
        {
            NodeId = -1;
        }
        
    }
 
    public void displayfilter_checkchanged(object s, EventArgs e)
    {
        if (CheckBox1.Checked)
        {
            dgGrid.MasterTableView.AllowFilteringByColumn = true;
 
        }
        else
        {
            dgGrid.MasterTableView.AllowFilteringByColumn = false;
 
        }
        dgGrid.GroupingSettings.CaseSensitive = false;
 
        dgGrid.Rebind();
 
 
    }
 
    protected void dgGrid_ItemInserted(object source, GridCommandEventArgs e)
    {
 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            ConfigureParamBO objConfigureParamBO = new ConfigureParamBO();
                       
            ParamGridItemBO pgiBO = new ParamGridItemBO();
            ParamGridBO objParamGridBO = new ParamGridBO();
            DataTable dtGridDataId = objParamGridBO.GetGridDataIdForNodeId();
            if (dtGridDataId.Rows.Count == 0)
            {
                Boolean isSuccess = SaveGridData();
                if (isSuccess)
                {
                   
                }
            }
            dtGridDataId = objParamGridBO.GetGridDataIdForNodeId(Convert.ToInt32(hidNodeId.Value));
             
            ParamGridBO pgBO = new ParamGridBO();
            Dictionary<string, object> Adds = new Dictionary<string, object>();
            Adds.Add("PARAM_GRID_ID", hidParamGridId.Value.ToString());
            
            dgGrid.InsertGridRecords(source, e, pgiBO, Adds);
           
            dgGrid.Rebind();
        }
    }
 
    protected void dgGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
 
        ParamGridItemBO pgiBO = new ParamGridItemBO();
        dgGrid.DataSource = pgiBO.getDgGridDataSource(NodeId);
    }
 
    
 
}

A demo source code would be of great help.

Can you please let me know the work around for it?

Thanking you in advance.

Jayesh Goyani
Top achievements
Rank 2
 answered on 30 Jun 2012
4 answers
128 views
In Radlistbox when Select "Shift button" all or mulitple  values
are not being able to select.
please find the example in the attach screen capture
Unknown
Top achievements
Rank 1
 answered on 29 Jun 2012
1 answer
242 views
how can I have the child grid open in insert mode? I tried a number of different things but it keeps saying that it can't find my linq datasource control when I rebind at the detail level or the master level. I need to be able to expand a row with command button and have the child detail grid loaded in insert mode all in one click.

When the rebind is called here at any level it yields this from ajax postback.
69|error|500|Cannot find DataSourceControl with ID 'ldsVendorRatingQualifications'|

Thanks,

protected void gridRatings_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == "AddNewChildRating") {
                GridDataItem parentRow = e.Item as GridDataItem;
                GridTableView parentGridView = parentRow.GetClosestParentControlByType<GridTableView>();
                RadGrid parentGrid = parentGridView.GetClosestParentControlByType<RadGrid>();
   
                parentRow.Expanded = true;
                //parentGridView.HierarchyDefaultExpanded = true;
                //parentGridView.DetailTables[0].InsertItem();
                parentGridView.DetailTables[0].IsItemInserted = true;
                parentGridView.DetailTables[0].Rebind();
    }
}

Ian
Top achievements
Rank 1
 answered on 29 Jun 2012
1 answer
138 views
I have  radgrid with 2 column and I am hiding the header with showheader= 'False' and also not defined HeaderText attribute in column declaration.  Radgrid is set to POPUP for edit mode.

when I go into edit mode  for update or insert. the header is still displays with ":" 
How do I completley avoid displaying the column header in edit mode. I just want the i/p  field no headings

Also I do not want to use form template, because the column i have is  GridHtmleditorColumn and  equivalent editor column is not displaying in editform tempalte

Thanks


NVB
Top achievements
Rank 1
 answered on 29 Jun 2012
1 answer
100 views
I am very new to telerik controls so please bear with me.
I have a radgrid with multiple template columns. In most of them I have checkboxes and in one I have a textbox. What I need to do is allow the user to edit the textbox value or checkbox checked state and have it reflected in the underlying data.
 
I guess the real question is are these controls databound to the underlying data automatically? If not, what is the best way to manage that?

When the data is bound to the grid, the checkbox state is set via the ItemDataBound event. I'd prefer to allow the user the ability to edit the data as needed and then post it back all at once. Is this possible?

On a different note, I would also like to not have a textbox in the cell but instead cause it to be directly editable when clicking in the cell. Maybe display a temporary textbox that updates the underlying data ... barring that, perhaps format the textbox so it does not appear as an editable cell unless clicked in.

Like I said, I am new to telerik controls so please be patient with me. I am open to all suggestions.

Thanks
Keith
Top achievements
Rank 2
 answered on 29 Jun 2012
2 answers
175 views
Hi all,

This follows from a question I posed in another forum related to rounded corners on buttons.

Is there a way to disable the rounded corners on the RadComboBox (using the Office2010Black skin)?

The reason that I want to do this is to make the RadComboBox control consistant with other controls such as the RadTextBox.

Having one control being squared off and then the next having rounded corners looks like I'm using controls from two different skins...

Best Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 29 Jun 2012
3 answers
188 views
I have implemented sorting on my RadGrid and wanted to know if I could change the sort order (asc/desc) when the user clicks the column to be sorted? I know if the user clicks the column again it will alternate between the two types of sorting (asc/desc) or no sort based on this article , but what I want to control, is the order of the sort when the column is first clicked. Currently on the first click the column sorts ascending, but I want it to sort descending when it is click for the first time. Thanks in advance
Pavlina
Telerik team
 answered on 29 Jun 2012
0 answers
228 views
I need to create a master details web page for a project I am working on. We have the 2012 version. I would have one item (description) that I think I could put in a grid or listbox and when the user selects that item I need to show the details of that selected item. I was thinking that I could use either a radgrid or radlistbox to display the description and once selected show the corresponding fields in an ajax panel. What does the telerilk team recommend me doing to doe this the best way possible? note: I see how this can be done within the gridview its self but I need the master (grid) and the details view to be in two seperate panels side by side. Also the details data must be editable.

Thanks,


Steve Holdorf
Steve Holdorf
Top achievements
Rank 1
 asked on 29 Jun 2012
1 answer
107 views
The "Visual Style Builder Info" sticky on this thread states that I can create a style with the stylebuilder site (which I did) then download the zip file and

    "Simply add the files from this archive to your project, and your custom skin is ready go
"

However, I am having a hard time figuring out how to do this exactly. I'm using Visual Studio 2010 and it isn't as simple as adding the CSS files from the archive and linking to them, I tried that. What am I missing?
Ivan Zhekov
Telerik team
 answered on 29 Jun 2012
6 answers
105 views
hi

in my case, i have fields in my DB start_time n End_timr
n i want to show shedule from start time to end time of that day.
example.
if one user has first appoitment start time at 10.a.m  the in schedular it shows 10.am n its last appoitment end time will br end time of schedule
according to db firlds i want dynamicaly time into schedular
n if on next day  he has appoitment start  at 2:pm then it shud shows start_time from 2.pm

Regards
Devang Tadvi
Ivana
Telerik team
 answered on 29 Jun 2012
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?