Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
Hi,
    I have a Hierarchy grid 3 levels. My data is all in the session. Grid is ViewState=false. Now in the update i have to also update all the levels for the item (parent, grand parent). The edit for is only at the deepest level (3). Update works fine with the detail table (3 level). now to update upper levels i have to set the grid data source = null so that i can call  the needdatasource, also need to call rebind() for the detail tables.
   If i do not Rebind(), after the update the edit form disappears ( proper behaviour) BUT when i use the datasource=null and Rebind() then data do get updated in all levels but the eidt form does not go away. I even tried calling clearedititems() but no avail. editmode makes no difference.
    Note : The edit form does go away if i click update again (2nd time) , also it does not call the updatecommand event the second time.
   As a quick fix, probably i can just redirect to the page so the edit form would not open initially.

whats the proper way of doing it ?

Thanks,

Regards,

Osman

plz : do not reply after 3 days asking for sample code ;)

I tried attaching ascreen shot, may be your radupload doesn't work properly...
Iana Tsolova
Telerik team
 answered on 29 Sep 2010
1 answer
122 views
Is it possible to change the EditText property of a gridEditCommand column programatically?
Princy
Top achievements
Rank 2
 answered on 29 Sep 2010
5 answers
263 views
On a page, we have a RadGrid. We're running into some problems that I am thinking might have to do with events firing, and in what order they fire. The error comes if you sort a column, then click to sort it again. After tracing down the code-behind, I think I see the problem, but I am curious if this is intended behavior, or if there's something we can do. The problem on our end stems from a particular variable in the code-behind. The variable is actually an object reference, and the error is a null reference exception thrown inside the Grid's ItemCreated event. The object is set in a  private method called in the Page_Load event.

I would post the code, but it is well over 1,000 lines long. So for simplicity's sake, here's the order of events I traced:

1) I enter the page -> Page_Load fires, populates the object reference and binds the RadGrid, also firing ItemCreated and using the reference with no problems
2) I click a column -> Page_Load fires again, populates the object reference again and apparently re-binds the RadGrid, firing the ItemCreated event and using the reference with no problems.
3) I click the same column to sort in the opposite direction -> ItemCreated fires and the object reference is null, crashing.

The private method call in Page_Load is NOT dependent on the page being a postback or not, - it is always called on Page_Load. So why does Page_Load fire on the first sort, but not on the second sort?

Thanks in advance for any help offered!

Ando Poore
Marin
Telerik team
 answered on 29 Sep 2010
3 answers
245 views
Greetings:

For a RadGrid with the following settings;

 

<ClientSettings EnablePostBackOnRowClick="true">

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 


And a RadContextMenu is configured as shown;

<

 

telerik:RadContextMenu ID="rcmContextMenu" iscontext="True" runat="server" Skin="Outlook"

 

 

OnItemClick="rcmContextMenu_ItemClick" contextmenuelementid="none">

 

 

<Items>

 

 

<telerik:RadMenuItem Text="Edit" />

 

 

 

<telerik:RadMenuItem Text="Delete" />
</

 

Items>

 

</

 

telerik:RadContextMenu>

 



The following occurs when a RadContextMenu is used on the RadGrid;

1) Right click on selected grid row.
2) Context menu appears as expected
3) An item is selected off of the context menu
4) RadGrid_SelectedIndexChanged event is fired
5) RadContextMenu_ItemClick event is fired

How is it possible to use a RadContextMenu when RadGrid_SelectedIndexChanged fires when an item is selected off of the context menu before RadContextMenu_ItemClick fires?


Marin
Telerik team
 answered on 29 Sep 2010
3 answers
594 views
Is it possible to store an attribute to the combo box instead of each item?  What I want to do is that when the SelectedItem is changed to update a different control.  I can't use find(<% %>) because my combobox is part of a user control and the control I want to update is part of a separate user control.

Any suggestions?
Kevin Donahue
Top achievements
Rank 1
 answered on 29 Sep 2010
3 answers
137 views

I want to have GridBinaryImageColumn that presents image from database. Can this image be inside hyperlink like

<a href="http://.../Product.aspx?Id=1"><img /></a> ?

Or any other approach that make image clickable and links to that row details?

Paul Desormeaux
Top achievements
Rank 1
 answered on 29 Sep 2010
1 answer
123 views
I would like to have a loading panel with out the animated image being shown, how can I do this
Daniel
Telerik team
 answered on 28 Sep 2010
1 answer
118 views
I need to export excel from Radgrid, but the date time column on the Excel is always right indented.  My user requests it left indent.  How I make this happened?

I tried to make the grid item left indent, but the column on the exported excel still right indented.

Please help!

Thanks
Daniel
Telerik team
 answered on 28 Sep 2010
1 answer
140 views
Hey all.

I am dynamically creating the various columns in a grid.  It is a Key value column (not visible), a simple bound column, and a number of Template columns that are dynamically added.
I am able to set the data without any problem.  However, I cannot retrieve che checkboxes in a save button click handler.

Any ideas are GREATLY appreciated.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="JobTitleEditor.ascx.cs" Inherits="LiaisonApp.Controls.JobTitleEditor" %>
<div id="JobTitleEditor">
    <asp:Button ID="btn_Save" runat="server" Text="Save" onclick="btn_Save_Click" />
    <telerik:RadGrid ID="grid_Data" runat="server" AutoGenerateColumns="False" GridLines="None" OnNeedDataSource="grid_Data_NeedDataSource">
        <ClientSettings EnableRowHoverStyle="True">
            <Scrolling AllowScroll="True" ScrollHeight="550px" UseStaticHeaders="True" />
            <Resizing AllowColumnResize="True" />
        </ClientSettings>
        <MasterTableView DataKeyNames="JobTitleID">
            <RowIndicatorColumn Visible="false" />
        </MasterTableView>
        <HeaderContextMenu EnableAutoScroll="True">
        </HeaderContextMenu>
    </telerik:RadGrid>
</div>

protected void btn_Save_Click(object sender, EventArgs args)
{
    foreach (GridDataItem item in grid_Data.MasterTableView.Items)
    {
        var row = GridDataTable.Rows.Find(item.KeyValues.ToInt());
        foreach (var jobFunction in JobFunctions)
        {
            var columnName = GetJobFunctionColumnName(jobFunction.ListEnumID);
            var checkbox = (CheckBox)item.FindControl( "chk_" + jobFunction.ListEnumID.ToString());
            row[columnName] = checkbox.Checked;
        }
    }
}

private class CheckboxColumnTemplate : ITemplate
{
    int _jobFunctionID = 0;

    public void InstantiateIn(Control container)
    {
        var checkbox = new CheckBox();
        checkbox.ID = "chk_" + _jobFunctionID.ToString();
        checkbox.DataBinding += new EventHandler(Checkbox_DataBinding);
        container.Controls.Add(checkbox);
    }

    void Checkbox_DataBinding(object sender, EventArgs args)
    {
        var checkbox = sender as CheckBox;
        var dataRow = (checkbox.NamingContainer as GridDataItem).DataItem as DataRowView;
        checkbox.Checked = dataRow.Row[GetJobFunctionColumnName(_jobFunctionID)].ToBool();
    }

    public CheckboxColumnTemplate(int jobFunctionID)
    {
        this._jobFunctionID = jobFunctionID;
    }
}

private void BuildGrid()
{
    var gridColumn = new GridBoundColumn();
    gridColumn.DataField = "JobTitleID";
    gridColumn.Visible = false;
    gridColumn.UniqueName = "JobTitleID";
    grid_Data.Columns.Add(gridColumn);

    gridColumn = new GridBoundColumn();
    gridColumn.DataField = "JobTitle";
    gridColumn.HeaderText = "Job Title";
    gridColumn.HeaderStyle.Width = new Unit(180, UnitType.Pixel);
    gridColumn.FooterStyle.Width = new Unit(180, UnitType.Pixel);
    gridColumn.ItemStyle.Width = new Unit(180, UnitType.Pixel);
    grid_Data.Columns.Add(gridColumn);

    foreach (var jobFunction in JobFunctions)
    {
        var newColumn = new GridTemplateColumn();
        newColumn.HeaderText = jobFunction.StringValue;
        newColumn.ItemTemplate = new CheckboxColumnTemplate(jobFunction.ListEnumID);
        newColumn.HeaderStyle.Width = new Unit(80, UnitType.Pixel);
        newColumn.FooterStyle.Width = new Unit(80, UnitType.Pixel);
        newColumn.ItemStyle.Width = new Unit(80, UnitType.Pixel);
        newColumn.UniqueName = GetJobFunctionColumnName(jobFunction.ListEnumID);
        newColumn.DataField = newColumn.UniqueName;

        grid_Data.Columns.Add(newColumn);
    }
}
Thomas
Top achievements
Rank 1
 answered on 28 Sep 2010
4 answers
92 views
Hi,
I am using telerik rad grid in web page with update panel and updae progress.
I also implemented pagination and it works finely.
But i got stuck when Filteration is not working.
I did following things
allowFilteringbycolumn = "true" in rad grid and master table view.
but i didn't working so far.
I didn't change any of the event of rad grid like need data source etc.
Please help!!!
I have to do it by tomorrow.!!!

Thanks in advance.
Pu






pu
Top achievements
Rank 1
 answered on 28 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?