Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hello,

Hope someone can help me out, i'm struggling with some thing that i want to do.

I have 


public class AttributeValue
{
        public string Name {get;set;}
        public string Value {get;set;}
}
  
public class Entry
{
        public string EntryName {get;set;}
        public List<AttributeValue> Attributes {get;set;}
}

All i want to do is binding a List<Entry> to a RadGrid and then show the Attributes as a columns. i'm thinking about having the Attributes radgrid inside the Entry radgrid.

<telerik:RadGrid ID="rgEntry" runat="server">
    <MasterTableView>
        <Columns>
            <telerik:GridTemplateColumn>
                <ItemTemplate>
                    <telerik:RadGrid ShowHeader="false" ShowFooter="false" runat="server" ID="rgAttributes">
                    </telerik:RadGrid>
                </ItemTemplate>
                <HeaderTemplate>
                     
                </HeaderTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Do you think i'm in the right way ? Or should i used Hierarchical Rad Grid or NestedViewTemplate ?

Thanks in advance





Jayesh Goyani
Top achievements
Rank 2
 answered on 17 Sep 2011
1 answer
70 views
Is there a way to know which records are returned after applying a filter? I need to gather all values of the key field when the records in the grid changes.

I have tried collecting the key value of each record in ItemDataBound event but that only returned records in one page. When there are more than one page, records in subsequent pages cannot be accessed through ItemDataBound.
Shinu
Top achievements
Rank 2
 answered on 17 Sep 2011
1 answer
105 views
I would like to change the sort behavior of the columns in my RadGrid.  Currently, when you click on a column, it sorts ascending.  I agree this is probably by design, but of course my client wants the column sorting descending when you first click the column.  Is this something that can easily be done?  A grid property??

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 17 Sep 2011
7 answers
147 views
hi all,
  I am using RadAlert for sisplaying messages to users. Project is multilingual and i can show localised message in the radalert byt passing localised message as parameters to the function. But any possibility to show the buttons like 'OK', 'CANCEL', YES' etc in localized language?

I read some article specifying 'language' property in the RAdWindowManager but i didnt found in my control. I am using Q3 2010. any possibility in Q1 2011? because i am going to use this latest version for next project
Akhil Raj
Top achievements
Rank 1
 answered on 17 Sep 2011
0 answers
87 views
I would like to implement a column chooser for the RADTreeList as the standard control does not have this functionality. Just wondered if anyone else has already done this and what method/control they have used. I had thought of using the RADWindow as this seemed to be a simple popup window which I could display when invoked (maybe from a context menu).

Unfortunately it seems that the RADWindow is not quite what I thought - I really wanted a simple popup container window.  Thanks for any other suggestions?
Chris
Top achievements
Rank 1
 asked on 16 Sep 2011
2 answers
77 views
Hi,

I already read this : 
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid

Basically i want to do the same thing, maybe you can point me to an example.

What i want to do is : 
I have a RadGrid that has 3 RadComboBox (in edit and insert mode).

For each radcombobox i want to have a hyperlink "Add new Item" that basically opens a new RadWindow (with a user controls inside), and when the user insert the new item, the radcombobox will be automatically updated, sorted and the new value selected without refreshing the page.

If anyone can hook me up with how to do this or any example ?

Thanks in advance
Al
Top achievements
Rank 1
 answered on 16 Sep 2011
4 answers
123 views
Hello,

Not all the skins have this error but I have noticed Outlook and WebBlue do. I'm not sure how to explain it which is why I have attached a screen shot. I am using Telerik version: 2010.1.519.35 and I have seen this in IE 7-9 as well as Safari 5.0.3 and Firefox 5.
Here is the code:

<telerik:RadMenu ID="RadMenu1" Skin="WebBlue" OnClientItemClicking="myClickFunction" runat="server" Flow="Horizontal">
    <ExpandAnimation Type="InOutQuad" />
</telerik:RadMenu>
Ramjet
Top achievements
Rank 1
 answered on 16 Sep 2011
4 answers
621 views
I have a RADGrid that requires that it's columns get removed and replaced per the context under which the data is being loaded. When the grid first loads, the Grouping operation runs fine. However, when the context changes and the Grid structure is reinitialized, when I try to group by any column I get the GridGroupByException: Expression cannot be null or empty error.

I start out with a Radgrid without column definitions. When the page loads, I invoke a procedure that first clears the Grids grouping, context menu, data binding and column settings then it runs an initialization routine to configure the grid for the data that will be loaded.

Here's the code for the ClearGridSettings method that's run first:

Private Sub ClearGridSettings()
       '   -   Clear Grouping/Sort Levels
       '   -   Clear Context Menus
       '   -   Clear Data Bindings
       '   -   Clear Columns
       With grdSubmission
           'Clear Grouping/Sort Levels
           .MasterTableView.GroupByExpressions.Clear()
           .MasterTableView.SortExpressions.Clear()
           'Clear Context Menus
           .ClientSettings.ClientEvents.OnRowContextMenu = ""
           'Clear Data Bindings
           .DataSource = ""
           .DataBind()
           'Clear Columns
           .Columns.Clear()
       End With
   End Sub

Here's the code for the first Intialization:
Private Sub InitializeSubmissionGrid(ByVal GridViewSchema As Int16)
    '##########################################
    'Initialize Data Grid for Submission Claims Review
    '   -   Reset Grid
    '   -   Get GridView Schema for Submissions Claim Listing
    '   -   Implement Column Structure
    '   -   Set Miscellaneous Parameters
    '###########################################
 
    ClearGridSettings()
 
    'Get Grid View Schema for Submissions View
    Dim objDW As New DWGlobals
    Dim ds As DataSet = objDW.GetGridViewSchema(GridViewSchema)
 
    With grdSubmission
        'Add Columns to Grid
        For Each objRow As DataRow In ds.Tables(0).Rows
            Dim objCol As New GridBoundColumn()
            .MasterTableView.Columns.Add(objCol)
            objCol.DataField = objRow("ColName")
            objCol.HeaderText = objRow("ColName")
            If Not IsDBNull(objRow("FormatString")) Then
                objCol.DataFormatString = objRow("FormatString")
            End If
            objCol = Nothing
        Next
 
        ' Set Miscellaneous parameters
        .ClientSettings.Resizing.AllowResizeToFit = True
        .ClientSettings.Resizing.AllowColumnResize = True
        .ClientSettings.Scrolling.AllowScroll = True
        .ClientSettings.Scrolling.UseStaticHeaders = True
        .AutoGenerateColumns = False
        .MasterTableView.GroupsDefaultExpanded = False
        .MasterTableView.GridLines = GridLines.Both
        .MasterTableView.AllowFilteringByColumn = False
        .MasterTableView.Caption = txtSubmLabel.Text & "...(Claim Qty: " & txtClaimQty.Text & " )"
    End With
 
End Sub

Here's the initialization code for the context change that's causing the error:



Private Sub InitializeFindingsGrid(ByVal GridViewSchema As Int16)
       '##########################################
       'Initialize Data Grid for Validation Findings Review
       '   -   Reset Grid
       '   -   Get GridView Schema for Validation Findings Listing
       '   -   Implement Column Structure
       '   -   Set Miscellaneous Parameters
       '###########################################
 
       ClearGridSettings()
 
       'Get Grid View Schema for Submissions View
       Dim objDW As New DWGlobals
       Dim ds As DataSet = objDW.GetGridViewSchema(GridViewSchema)
       objDW = Nothing
 
       Dim exp As New GridGroupByExpression()
       Dim gbf As New GridGroupByField()
 
       With grdSubmission
           'Add Columns to Grid
           For Each objRow As DataRow In ds.Tables(0).Rows
               Dim objCol As New GridBoundColumn()
               objCol.DataField = objRow("ColName")
               objCol.HeaderText = objRow("ColName")
               objCol.UniqueName = objRow("ColName")
               If Not IsDBNull(objRow("FormatString")) Then
                   objCol.DataFormatString = objRow("FormatString")
               End If
               objCol.GroupByExpression = objRow("ColName")
 
               'Add GroupByField to GroupByExpression
               'gbf = New GridGroupByField
               'With gbf
               '    .FieldName = objRow("ColName")
               '    .HeaderText = objRow("ColName")
               '    .HeaderValueSeparator = " HeaderValSep "
               '    .Aggregate = GridAggregateFunction.Count
               'End With
               'exp.SelectFields.Add(gbf)
               .MasterTableView.Columns.Add(objCol)
               objCol = Nothing
           Next
 
           'Add GroupByExpression object to table
           ' .MasterTableView.GroupByExpressions.Add(exp)
 
           ' Set Miscellaneous parameters
           .ClientSettings.Resizing.AllowResizeToFit = True
           .ClientSettings.Resizing.AllowColumnResize = True
           .ClientSettings.Scrolling.AllowScroll = True
           .ClientSettings.Scrolling.UseStaticHeaders = True
           .AutoGenerateColumns = False
           .MasterTableView.GroupsDefaultExpanded = False
           .MasterTableView.GridLines = GridLines.Both
           .MasterTableView.AllowFilteringByColumn = False
           .MasterTableView.Caption = "Findings For " & txtSubmLabel.Text & _
                                      "...( " & txtFindingType.Text & ")"
           'Enable Grid Options for Findings Review
           .AllowMultiRowSelection = True
           .ClientSettings.Selecting.AllowRowSelect = True
           .ClientSettings.Selecting.EnableDragToSelectRows = True
           .ClientSettings.ClientEvents.OnRowContextMenu = "RowContextMenu"
 
       End With
 
       exp = Nothing
       gbf = Nothing
 
   End Sub

As you can see by the commented out section I tried to explicitly set GridGroupByFields but that didn't work either. I also tried setting the GroupByExpression on a column by column basis with the same result.

What am I missing?
Michael Bierch
Top achievements
Rank 1
 answered on 16 Sep 2011
2 answers
155 views
Hi Every one,

this is what I am doing on client side

<telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            function OnClientSelectedIndexChanged_Country(sender, eventArgs) {
                var item = eventArgs.get_item();
                var inputElement = document.getElementById("<%= rpbMainInfo.FindItemByValue("CandidateInformation").FindControl("rtxtState").ClientID %>"); 
                 
                var Combo = document.getElementById("<%= rpbMainInfo.FindItemByValue("CandidateInformation").FindControl("rcbState").ClientID %>");
                if (item.get_selectedItem() == "United States") {
                    Combo.set_visible = true;
                    inputElement.set_visible = false;
                }
                else {
                    Combo.set_visible = false;
                    inputElement.set_visible = true;
                }
            }        
        </script>
    </telerik:RadCodeBlock>


<telerik:RadComboBox ID="rcbCountry" runat="server" DataSourceID="sdsCountries" DataTextField="COUNTRY"
                                                        DataValueField="COUNTRYCODE" Skin="Outlook" EmptyMessage="Please Select.."
                                                         OnClientSelectedIndexChanged="OnClientSelectedIndexChanged_Country">
                                                    </telerik:RadComboBox>


What I am trying to do is when the user selects the country as Unitedstates the combo box for states should be visible and when Country other than United states then the states would be a text box.I am able to do this on server side .But I am not able to get on client side .....

CAn we do it on client side or only sever side.




Can Any one help me with this please.


Thanks,
Sravanthi
sravanthi
Top achievements
Rank 1
 answered on 16 Sep 2011
3 answers
129 views
I've got a self-referencing hierarchical grid that displays the information as desired.  When the user clicks a row, s/he can then either view the row's details, reply to the thread or delete the thread.

The problem I'm having is capturing the Id of the selected row.  The Id is stored in the first column of the grid, which also contains the [+] button code (visible or not, depending on whether there's a child row).  For other columns, the following to retrieve the cell's contents as desired:

                        var rgGrid = $find("<%= grdNotes.ClientID %>");
                        var MasterTable = rgGrid.get_masterTableView();
                        var selectedRows = MasterTable.get_selectedItems();
                        for (var i = 0; i < selectedRows.length; i++)
                        {
                            var row = selectedRows[i];
                            var cell = MasterTable.getCellByColumnUniqueName(row, uniqueColName)
                            parentId = cell.innerHTML;
                        }                       

However, when the uniqueColName is the "Id" column, I also get back the HTML that creates the [+] button (when all I want is 21):

<input type="submit" name="ctl00$DetailBodyPlaceHolder$ucNotesGrid$grdNotes$ctl00$ctl10$MyExpandCollapseButton" value="" id="ctl00_DetailBodyPlaceHolder_ucNotesGrid_grdNotes_ctl00_ctl10_MyExpandCollapseButton" class="rgExpand" style="visibility:hidden;" />&nbsp;21

I've tried moving the button to its own column, but have been unsuccessful.

How can I read the Id value w/o getting the [+] code back as well?  Is there another property that will just return the value (e.g., 21)?

Also, how can I make the detail row line up with the parent row vs. being indented?
D
Top achievements
Rank 1
 answered on 16 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?