Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
112 views
I have a grid that I add a dynamic groupby expression that defaults as collapsed and it works fine.
However, whenever I postback the grid doesn't recall the states of which were expanded and
resets all to collapsed.  I have seen in the online examples that the grid can retain this information
on postback.  The only difference I can notice on the code is that the example is declared in the
ASPX page and mine in code behind.  The reason that I do not declare mine in the ASPX page is
because my grid can switch datasources and gets grouped by different columns.  Any ideas? 
I have seen on here that some people suggest EnableViewState="True" for the grid, however,
isn't it enabled by default?  Additionally, in case it matters, my grid is located in an UpdatePanel.
Let me know if anyone has any ideas?  Thanks in advance.

Joshua 
Josh
Top achievements
Rank 1
 answered on 05 Jun 2009
1 answer
103 views
How can I access the DataRow thats bound to the specific Rotator Item when I am handling the ServerSide Click Event?
Fiko
Telerik team
 answered on 05 Jun 2009
1 answer
55 views
The insert and cancel buttons on the image editor do not display when the image editor is loaded.  The user can open and close the upload menu, which will cause the insert and cancel buttons to appear.  This seems to be an issue with IE6 when using custom dialogs.  I used the standard dialogs that were packaged with the install.  I also tried removing the changes that I made to see if it was something that I had changed, but the issue is still occurring

Is there a quick fix that I can add to one of the dialogs to get this to work in IE6?
Martin
Telerik team
 answered on 05 Jun 2009
3 answers
344 views

Grid with nested view is reporting the following error when I execute the Insert or Edit command.  Without the nested view, Insert and Edit works fine in grdEntities.  The nested view portion works fine right now as is(including the user control assocaited with the grdEndorsements).  What happens is that when I issue the Insert Command from the grdEntities header or an Edit command from one of the rows in the grdEntities mastertable, I get the following error:

The DataSourceID of 'grdEndorsements' must be the ID of a control of type IDataSource.  A control with ID 'SDSGetEndorsements' could not be found.

Here is the code:

<telerik:RadGrid ID="grdEntities" runat="server" Skin="Telerik" 
GridLines="None" AllowPaging="True" AllowSorting="True" Width="99%" AutoGenerateColumns="False" 
ShowStatusBar="True" Visible ="true" ShowFooter="True" AllowMultiRowEdit="true">  
<MasterTableView GridLines="None" Width="100%" CommandItemDisplay="Top"   
   DataKeyNames="EntityID" NoMasterRecordsText="No Entities to Display." > 
<NestedViewTemplate> 
<asp:Label ID="LabelEntityID" Font-Bold="true" Font-Italic="true" Text='<%# Eval("EntityID") %>' 
            Visible="false" runat="server" /> 
     <telerik:RadGrid ID="grdEndorsements" runat="server" Skin="Telerik" 
    GridLines="None" AllowPaging="True" AllowSorting="True" Width="99%" AutoGenerateColumns="False" 
    ShowStatusBar="True" Visible ="true" ShowFooter="True" DataSourceID="SDSGetEndorsements">  
    <MasterTableView GridLines="None" Width="100%" CommandItemDisplay="Top" HierarchyLoadMode="ServerOnDemand"   
       DataKeyNames="EndorsementID" NoMasterRecordsText="No Endorsements to Display." PageSize="5">  
    <CommandItemSettings AddNewRecordText="Add New Endorsement" /> 
    <Columns> 
        <telerik:GridEditCommandColumn> 
        </telerik:GridEditCommandColumn> 
        <telerik:GridBoundColumn UniqueName="EndorsementID" HeaderText="EndorsementID" DataField="EndorsementID" Visible="False" > 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn UniqueName="EntityID" HeaderText="EntityID" DataField="EntityID" Visible="False" > 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn UniqueName="EndorsementName" HeaderText="Name" DataField="EndorsementName" Visible="True" > 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn UniqueName="EndorsementTitle" HeaderText="Title" DataField="EndorsementTitle">  
        </telerik:GridBoundColumn>                      
        <telerik:GridBoundColumn UniqueName="EndorsementSSN"  HeaderText="SSN" DataField="EndorsementDate">  
        </telerik:GridBoundColumn>   
        <telerik:GridBoundColumn UniqueName="EndorsementDate" HeaderText="Date Endorsed" DataField="EndorsementDate">  
        </telerik:GridBoundColumn> 
 
    </Columns> 
    <EditFormSettings  UserControlName="~/UserControls/AddEditEndorsement.ascx" EditFormType="WebUserControl">  
        <EditColumn UniqueName="EditCommandColumnE1">  
        </EditColumn> 
    </EditFormSettings> 
    <ExpandCollapseColumn> 
        <HeaderStyle Width="20px" /> 
    </ExpandCollapseColumn> 
    <RowIndicatorColumn> 
        <HeaderStyle Width="20px" /> 
    </RowIndicatorColumn> 
    </MasterTableView> 
    <ClientSettings> 
        <Scrolling AllowScroll="False" /> 
    </ClientSettings> 
    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" /> 
    <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" /> 
    <AlternatingItemStyle HorizontalAlign="Left" VerticalAlign="Middle" /> 
    </telerik:RadGrid>                  
    <asp:SqlDataSource ID="SDSGetEndorsements" runat="server"   
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"   
        SelectCommand="SELECT * FROM [OldEndorsements] WHERE ([EntityID] = @EntityID)">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="LabelEntityID" PropertyName="Text" Type="String" Name="EntityID" /> 
            </SelectParameters> 
    </asp:SqlDataSource> 
 
</NestedViewTemplate> 
<CommandItemSettings AddNewRecordText="Add New Entity" /> 
<ExpandCollapseColumn> 
    <HeaderStyle Width="20px" /> 
</ExpandCollapseColumn> 
<Columns> 
    <telerik:GridEditCommandColumn> 
    </telerik:GridEditCommandColumn> 
    <telerik:GridBoundColumn UniqueName="EntityID" HeaderText="EntityID" DataField="EntityID" Visible="False" > 
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn UniqueName="EntityType" HeaderText="EntityType" DataField="EntityType" Visible="False" > 
    </telerik:GridBoundColumn> 
     <telerik:GridBoundColumn UniqueName="EntityName" HeaderText="Name" DataField="EntityName" Visible="True" > 
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn UniqueName="EntityAddress" HeaderText="Address" DataField="EntityAddress">  
    </telerik:GridBoundColumn>                      
    <telerik:GridBoundColumn UniqueName="EntityAddress2" HeaderText="Address2" DataField="EntityAddress2">  
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn UniqueName="EntityCity"  HeaderText="City" DataField="EntityCity">  
    </telerik:GridBoundColumn>   
    <telerik:GridBoundColumn UniqueName="EntityState" HeaderText="State" DataField="EntityState">  
    </telerik:GridBoundColumn>                      
    <telerik:GridBoundColumn UniqueName="EntityZip" HeaderText="Zip" DataField="EntityZip">  
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn UniqueName="EntityTaxID" HeaderText="Tax ID" DataField="EntityTaxID">  
    </telerik:GridBoundColumn>    
    <telerik:GridBoundColumn UniqueName="EntityTypeDesc" HeaderText="Type" DataField="EntityTypeDesc">  
    </telerik:GridBoundColumn> 
   
</Columns> 
<EditFormSettings  UserControlName="~/UserControls/AddEditEntity.ascx" EditFormType="WebUserControl">  
    <EditColumn UniqueName="EditCommandColumn1">  
    </EditColumn> 
</EditFormSettings> 
</MasterTableView> 
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" /> 
<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" /> 
</telerik:RadGrid> 

Thanks.


 

Princy
Top achievements
Rank 2
 answered on 05 Jun 2009
1 answer
87 views
Hi,

I am having this strange set of problem. I am binding the grid at 2 places, once at page load and once when setting a value. Both are calling Grid.Rebind. But Rebind is not firing grid_needDatasource event when called for the second time after pageload. If Iam removinf Grid.Rebind from Pageload, then My item_command event is not being fired. I'll appreciate any solution to this problem
Shinu
Top achievements
Rank 2
 answered on 05 Jun 2009
1 answer
1.6K+ views
Hi,

I am trying to acess a radiobuttonlist which is placed inside a radgrid, so that i can insert its selected value into my database.
I realized that I need to use FindControl, but can't get it to work... the name of my grid is "FichaConteúdo".
I tried:

Control myRadioBtnListTipo = FichaConteúdo.FindControl("RadioBtnListTipo");
sel = myRadioBtnListTipo.SelectedValue;

and also:

Control myRadioBtnListTipo = FichaConteúdo.MasterTableView.Items.FindControl("RadioBtnListTipo");

The problem is that I can't access "SelectedValue", it doesn't appear... I really need the selected value so that I can use it as an sql parameter in my query...
Any suggestions please?

Thank you,
Marta
Shinu
Top achievements
Rank 2
 answered on 05 Jun 2009
2 answers
182 views
Hi There,

I have a RadTreeView (Q2 2008) inside of an UpdatePanel.  Also inside the UpdatePanel is a button that deletes all the "checked" nodes.

I'm using jQuery to extend the functionality so that all the child nodes get checked and unchecked with the parent node.  If one of the child nodes is unchecked, the parent checkbox is unchecked too (but not the prev and next child checkboxes).  I was able to achieve this using the following code:

function pageLoad() { 
        $('.rtChk').bind('click'function() { 
 
            // Check/uncheck child checkboxes 
            var parentLi = $(this).parents('.rtLI:first'); 
            if ($(this).is(':checked')) 
                $(parentLi).find('.rtChk:not(:first)').attr('checked'true); 
            else 
                $(parentLi).find('.rtChk:not(:first)').attr('checked'false); 
 
            // Uncheck parent checkbox on uncheck 
            var grandParentLi = $(this).parents('.rtLI:first').parents('.rtLI:first'); 
            if ($(this).is(':checked') == false
                $(grandParentLi).find('.rtChk:first').attr('checked'false); 
        }); 
    } 

This code is working out great and when I uncheck one of the child nodes, the parent appears to be uncheck... however, when I click the button to delete all checked nodes, the parent still gets deleted.  I'm thinking that somewhere along the way, the jQuery "uncheck" isn't registering with my asyncronos postback?

I have a RadScriptManager on the page and I've tried registering the script using Page.RegisterStartupScript... but it still doesn't work.

Any suggestions?




Derek Hunziker
Top achievements
Rank 1
 answered on 04 Jun 2009
5 answers
165 views
Hi,

I have a raddocklayout with dynamically created zones and docks (inside an updatepanel) that I am using to allow users to edit the layout of their custom web page. I have found that if I don't allow an ajax command to complete (from dock A) before then attempting to drag another dock (B) it seems to recreate dock B in its original location (whilst I still have dock B being dragged) thus creating two copies of B.

I expect this issue would be fixed by preventing any dragging or commands from being executed when an ajax command is being processed. I also wish to prevent the user from clicking on a command twice as they await its execution.

So, my question is if its possible to "disable" all the docks or prevent the docks from being dragged/executing commands when an ajax callback is underway? I assume this would have to be done using javascript as any server side code won't disable the commands/drag functionality until after the postback (and subsequent updatepanel changes have occurred).

I hope that makes sense, let me know if you require further details.
Pete
Top achievements
Rank 1
 answered on 04 Jun 2009
1 answer
239 views

Below is code that I have for my custom filter column.  Everything works great, however, if I select
"All" from the radcombobox I get "No records to display."  I am not sure if it is set up correctly to
either remove the the currentfilterfunction and value or how I set the column to no NoFilter when
"All" is chosen.  Any ideas?  Below is the code.  Thanks is advance.

Joshua

public class MyCustomFilteringColumn : GridBoundColumn  
{  
 
    //RadGrid will call this method when it initializes the controls inside the filtering item cells  
    protected override void SetupFilterControls(TableCell cell)  
    {  
        base.SetupFilterControls(cell);  
        cell.Controls.RemoveAt(0);  
        Telerik.Web.UI.RadComboBox combo = new Telerik.Web.UI.RadComboBox();  
        combo.ID = ("RadComboBox1" + this.UniqueName);  
        combo.ShowToggleImage = false;  
        combo.Skin = "Office2007";// "Web20";  
        combo.EnableLoadOnDemand = true;  
        combo.AutoPostBack = true;  
        combo.MarkFirstMatch = true;  
        combo.Height = Unit.Pixel(100);  
        combo.Width = Unit.Pixel(60);  
        combo.ItemsRequested += this.list_ItemsRequested;  
        combo.SelectedIndexChanged += this.list_SelectedIndexChanged;  
        cell.Controls.AddAt(0, combo);  
        cell.Controls.RemoveAt(1);  
    }  
 
    //RadGrid will cal this method when the value should be set to the filtering input control(s)  
    protected override void SetCurrentFilterValueToControl(TableCell cell)  
    {  
 
        base.SetCurrentFilterValueToControl(cell);  
        RadComboBox combo = (RadComboBox)cell.Controls[0];  
 
        if ((this.CurrentFilterValue != string.Empty))  
        {  
            combo.Text = this.CurrentFilterValue;  
        }  
    }  
 
    //RadGrid will call this method when the filtering value should be extracted from the filtering input control(s)  
    protected override string GetCurrentFilterValueFromControl(TableCell cell)  
    {  
        RadComboBox combo = (RadComboBox)cell.Controls[0];  
        return combo.Text;  
    }  
 
    private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)  
    {  
        ((RadComboBox)o).DataTextField = this.DataField;  
        ((RadComboBox)o).DataValueField = this.DataField;  
        ((RadComboBox)o).DataSourceID = Global.GridDS;  
        ((RadComboBox)o).DataBind();  
        ((RadComboBox)o).Items.Insert(0, new RadComboBoxItem("All"""));  
    }  
 
    private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
        GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;  
 
        if ((this.UniqueName == "Index"))  
        {  
            //this is filtering for integer column type   
            filterItem.FireCommandEvent("Filter"new Pair("EqualTo"this.UniqueName));  
        }  
        //filtering for string column type  
        filterItem.FireCommandEvent("Filter"new Pair("Contains"this.UniqueName));  
    }  
}  
Josh
Top achievements
Rank 1
 answered on 04 Jun 2009
3 answers
119 views
hi team telerik
How Can Grid Switch to Insert Mode in Page load?
Phil
Top achievements
Rank 2
 answered on 04 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?