Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
254 views
Hello,
i have radgrid with grouping on two levels, here is the aspx code:
...
<GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldAlias="Proces" FieldName="Proces" HeaderText="<%$ Resources:StartRes, Lb_Proces %>">
                                        </telerik:GridGroupByField>
                                    </SelectFields>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="Proces" SortOrder="Descending"></telerik:GridGroupByField>
                                    </GroupByFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldAlias="Postapka" FieldName="Postapka" HeaderText="<%$ Resources:StartRes, Lb_Predmet %>">
                                        </telerik:GridGroupByField>
                                        <telerik:GridGroupByField FieldAlias="BrPRedmet" FieldName="BrPRedmet" HeaderText="<%$ Resources:StartRes, BrPRedmet %>">
                                        </telerik:GridGroupByField>
                                        <telerik:GridGroupByField FieldAlias="DelSubjekt" FieldName="DelSubjekt" HeaderText="<%$ Resources:StartRes, Tv_DSubjekti %>">
                                        </telerik:GridGroupByField>
                                    </SelectFields>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="BrPRedmet"  SortOrder="Descending"></telerik:GridGroupByField>
                                    </GroupByFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
...
On Page load i need all group columns to be collapsed, on the first and on the second level. In the code behind i have code to collapse the group columns on the first level. The problem is that i can't access the group columns on the second grouping level. With debugging i found that RadGrid1.MasterTableView.Controls[0].Controls[1].Controls are the  group columns on the second level, but i don't know how to cast them so i can set Expand attribute to false. Here is the code that i use to collapse group columns on first level: 
 
foreach (GridItem item in RadGrid1.MasterTableView.Controls[0].Controls)
                {
                    item.Expanded = false;
}

If i try to access group columns on the second level with GridItem cast 

foreach (GridItem item in RadGrid1.MasterTableView.Controls[0].Controls)
                {
                    item.Expanded = false;
                    foreach (GridItem subitem in item.Controls[1].Controls)
                    {
                        
                    }
                }

 i get the message 

Unable to cast object of type 'Telerik.Web.UI.GridTableHeaderCell' to type 'Telerik.Web.UI.GridItem'.

Please help me how to cast the group columns on the second level so i can collapse them all on Page Load, or tell me some other solution for collapsing group columns. 

Thank you and pardon my English, not that good.
Elena
Top achievements
Rank 1
 answered on 21 May 2011
3 answers
161 views
Hi,

I have following template column i a Radgrid. (using in connection with a product order where a user can choose a number of products.)
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkProduct" runat="server" />
                    </ItemTemplate>
            </Columns>

At the code behind I want to find out which products are choosen by the users (when I save product orders into database), in other words I want to know which are the checkbox's are checked at the save.

I hope someone can help me.

Thanks,
Thaya


Jayesh Goyani
Top achievements
Rank 2
 answered on 21 May 2011
3 answers
48 views
Hi,

I have custom Style listed in Editor Apply CSS class dropdown. These styles are loaded from a style sheet and it works perfect in all browsers except IE and that too in IE all styles are loaded perfectly except one style named "Normal". I am sure there won't be any issues with that style because it is loading in FF and chrome. I am not sure whats going wrong. Can some one help me to load that style in IE also.

Thanks,
Akila.
Akila Kumarasamy
Top achievements
Rank 1
 answered on 21 May 2011
6 answers
181 views
I want to style radspell button. When I try to add the class to the RadSpell control, it doent  apply to the button but rather styles the surrounding areas. Is there a way I can style the radspell button.

thanks
TechSavvySam
Top achievements
Rank 1
 answered on 21 May 2011
1 answer
113 views
referencing your example:

http://demos.telerik.com/aspnet-ajax/listview/examples/definingstructure/declarativedefinition/defaultcs.aspx

you use this bit of markup:

  <LayoutTemplate>
                    <div class="RadListView RadListView_<%#Container.Skin %>">


When I use the exact same code in my page the result renders as:

  <LayoutTemplate>
                    <div class="RadListView RadListView_Default">


Even though the page is using the Sunset skin and buttons are rendering on the page properly with the Sunset skin.

If I hard code this in the page:

  <LayoutTemplate>
                    <div class="RadListView RadListView_Sunset">

It works exactly as I want (but obviously won't work if we change the site's Skin).


TechSavvySam
Top achievements
Rank 1
 answered on 20 May 2011
3 answers
99 views

I have implemented a portal page that allows users to position docks in three zones or float additional docks around the interface.   This allows users with different screen resolutions to make use of their full screen and not be bound to our web portals sizing when having multiple docks on the screen.

To facilitate this I have written a script to ensure that users cannot move floating docks outside of the current screen bounds.  However, the problem I am running into is losing docks when the browser window is resized.   Tapping into a resize event handler for the browser is easy enough but I can’t find a command to cycle through all the open (or just floating) RadDocks to get their current positions so I can reposition them based on the screen resize.

Is there a command similar to cycling through a DockState in C for Java on the client side???

TIA

Gimmik
Top achievements
Rank 1
 answered on 20 May 2011
4 answers
277 views
I have a radgrid inside a user control that disappears when in edit mode or add new mode.   works just fine when the grid is inside an aspx page but when placed inside an ascx, it breaks.  any ideas?
Sergiu
Top achievements
Rank 2
 answered on 20 May 2011
3 answers
77 views
Hi I am on the latest internal build and I have a page with validation controls on it and I can not switch tabs on the ribbonbar without firng the validation.
Sam
Top achievements
Rank 1
 answered on 20 May 2011
4 answers
423 views
I am using the ASP.net version of the rad controls (RadControls for ASP.NET AJAX Q1 2011 SP1). I have a RadComboBox that, when the value is set to Other, should display a RadTextBox for data entry, here is the definition and JavaScript i am using:

<telerik:RadComboBox runat="server" ID="rcbIndustry" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" Skin="Black" Width="269" EnableEmbeddedSkins="false" />
<span id="tmp"></span>
<telerik:RadTextBox runat="server" ID="rtbIndustryOther" Skin="Black" Width="250" EnableEmbeddedSkins="false" />
<script>
    function OnClientSelectedIndexChanged(sender, eventArgs) {
        if (eventArgs.get_item().get_value() == 'Other') {
            $find("#<%= rtbIndustryOther.ClientID %>").set_visible(true);
            $("#tmp").html('<br>');
        }
        else {
            $("#<%= rtbIndustryOther.ClientID %>").set_visible(false);
            $("#tmp").html('');
        }
    }
    $find("#<%= rtbIndustryOther.ClientID %>").set_visible(false);
</script>


The last line in the script ($find("#<%= rtbIndustryOther.ClientID %>").set_visible(false);) immediately throws an error:
 "Microsoft JScript runtime error: Unable to get value of the property 'set_visible': object is null or undefined"

What am I doing wrong as this is driving me nuts...
Dmitri
Top achievements
Rank 1
 answered on 20 May 2011
2 answers
90 views
Yes, it's time for another dumb questions from yours truly.

I'm often surprised by how many times I find myself doing something for the first time, even though I've been doing this kind of work for a while now. Anyhow, here's the thing. I have a page with code on it that includes this ...

<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1" >
  <script type="text/javascript">
      $(document).ready(function ()
      {
          var addEditEventDialog = new CalendarAddEditEventObject();
      });
  </script>
</telerik:RadScriptBlock>

The constructor of the object being created includes code to attach a couple of client-side event handlers and it all works fine. Until, that is, my page does an Ajax callback. At this point my handlers stop working.

Now, I've found a workaround but I'm unsure if it is the right work around. I've added RadScriptBlock1 in to the set of updated controls in the AjaxManager.

What should I be doing?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 20 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?