Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
728 views
Hello,
I have a grid with GridClientSelectColumn column and client setting with AllowRowSelect="true". Furthermore, on

ItemDataBound

event, I hide the checkbox based on some logic, because I want only specific rows to be selected. The problem is that even if I hide the checkbox, the grid allows the row to be selected by simply clicking anywhere on the row. What is a proper way to setup a grid that allows only specific rows to be selectable?

Thank you.

 

 

 

 

Eyup
Telerik team
 answered on 26 Jul 2012
5 answers
140 views
Hi,

  What is the easiest way to add a text message above the input fields in the upload window in file explorer?

Thanks,

Jed
Vessy
Telerik team
 answered on 26 Jul 2012
4 answers
439 views
I've just upgraded to Q2 2012 and I'm now having a problem with code that has worked for months without any issues.  I've got an onkeyup function on a RadTextBox, which then fires an ajax request to get search results as the user types.  In Q2 2012 the value of the text box is not being consistently set before my onkeyup function is run.  So if I put a break point in the function I get

>>> $find("ctl00_MainContent_SearchBox").get_value()
""
>>> $find("ctl00_MainContent_SearchBox").get_textBoxValue()
"d"

In code behind when I do SearchBox.Text I get the blank value, not the text.  As soon as my onkeyup event has finnished the value is set correctly.  I did not have this issue in Q3 2011.

If I change the RadTextBox to an asp:TextBox the issue goes away.
Roelof
Top achievements
Rank 1
 answered on 26 Jul 2012
1 answer
173 views
Using latest(2012, 2, 607, 40) version I have one notification control on the page.
In code, I can set and show the notification and it shows fine.
But when I set and show the notification from the ItemCommand in a raggrid, then notifiaction shows no text in the title or text; It still has the notification popup with Icon, and that's it......

<

asp:Content ID="Content1" ContentPlaceHolderID="cp" runat="Server">

    <telerik:RadAjaxManager runat="server" ID="ram" DefaultLoadingPanelID="rlp">

        <AjaxSettings>

            <telerik:AjaxSetting AjaxControlID="btnNew">

                <UpdatedControls>

                    <telerik:AjaxUpdatedControl ControlID="rgvPolicy" />

                </UpdatedControls>

            </telerik:AjaxSetting>

            <telerik:AjaxSetting AjaxControlID="rgvPolicy">

                <UpdatedControls>

                    <telerik:AjaxUpdatedControl ControlID="rgvPolicy" />

                </UpdatedControls>

            </telerik:AjaxSetting>

        </AjaxSettings>

    </telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel runat="server" ID="rlp">

</telerik:RadAjaxLoadingPanel>

<telerik:RadNotification AutoCloseDelay="0" Animation="Resize" AnimationDuration="500" runat="server" ID="rn" Position="Center" Width="400" />

<div class="generic-container" style="margin:10px;"> ...

 

 

Protected Sub rgvPolicy_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgvPolicy.ItemCommand

    If TypeOf e.Item Is GridDataItem And e.CommandName = "Delete" Then

        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

        Dim ID = DirectCast(item.GetDataKeyValue("PolID"), Integer)

        Dim desc = item("PolDescription").Text
 

        proj.espManager(schema).PolicyManager.Item(ID).Delete()

        rgvPolicy.Rebind()

 

        With rn

            .TitleIcon = IconURL(Buttons.ButtonFunction.Ok)

            .Title = "Policy Deleted"

            .Text = String.Format("Policy '{0}' and all its calculations have been deleted.", desc)

            .Show()

        End With

    End If

End Sub

Protected Sub RadButtonEx1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButtonEx1.Click

    With rn

        .TitleIcon = IconURL(Buttons.ButtonFunction.Ok)

        .Title = "AAAAAAAAAAAAAARG"

        .Text = String.Format("Policy '{0}' and all its calculations have been deleted.", "YADDA")

        .Show()

    End With  

End Sub

Marin Bratanov
Telerik team
 answered on 26 Jul 2012
5 answers
132 views
I have a fairly sophisticated grid with 22 visible columns. The data source is a collection derived from List<T>. There are more columns in the records than displayed. The grid allows for grouping, filtering, tri-mode multi-column sorting, and editing (no paging). The display of the grid changes based on flags which are re-evaluated at each Ajax postback.

So based on that, is it clear which Excel export format to use? : HTML, SpreadsheetML, or BIFF

I don't understand exactly how RadGrid goes about generating a spreadsheet document. In RadGrid_ItemCommand, I check as follows:

if (e.CommandName == RadGrid.ExportToExcelCommandName)
  isExcelExport = true;

What do I do with that isExcelExport information now that I know what the user wants? The code looks like it goes through the standard event cycle, but generates different format output rather than building the web form with related controls. Is that accurate? Do I need to populate the following in ItemCreated or ItemDataBound?

if (isExcelExport)
{
    if (e.Item is GridHeaderItem)
    {
    }
    if (e.Item is GridDataItem)
    {
    }
    if (e.Item is GridFooterItem)
    {
    }
    return;
}

And do I need to do something to wrap up in RadGrid_PreRender or elsewhere?

I'm familiar with SpreadsheetML, and I develop Excel Addins, so I'm familiar with the internals, but I'd prefer to let the RadGrid do as much for us as possible. For example, can Excel headers and other styling be inherited from the grid?

I just need to know how much control I need to exercise over the creation process of the workbook, worksheet, and individual rows, columns, and cells. I don't see this spelled out anywhere as to what needs to be done or where for each output type.

And can we control the workbook headers, setting Author and other properties which are available to both ML and binary files?

Thanks!!
Daniel
Telerik team
 answered on 26 Jul 2012
1 answer
98 views

When I use GradientFillStyle.Center the Pie chart is not correctly rendered.

  1. The red and yellow slice are not usually not completely filled in.
  2. Sometime the with of the border between the yellow and red slice is extremely thick.

However there are no rendering issues if I use any of the other fill sytles.   I've attached screen shots to this thread to illustrate the difference in the chart's when GradientFillStyle.Center is used and when it's not.


Ves
Telerik team
 answered on 26 Jul 2012
1 answer
46 views

I am trying to use grouping to one of the RadGrid where all the columns are autogenerated
 
i applied the code.
 

ShowGroupPanel="True" (RadGrid attribute)

and

<ClientSettings AllowDragToGroup="True" >
 
</ClientSettings>
 
But when ever I am dragging one column to the group panel ,
 getting this
 
Error: Sys.WebForms.PageRequestManagerServerErrorException: Unable to cast object of type 'Telerik.Web.UI.GridGroupSplitterColumn' to type 'Telerik.Web.UI.GridBoundColumn'.

 
Please Help

Regards
 Arijit Chatterjee

Pavlina
Telerik team
 answered on 26 Jul 2012
2 answers
172 views
Is this possible without javascript / radtooltipmanager? We would like to have things like "<strong>Tool Tip</strong> Text" display for items in a radmenu. The same text is loaded as a tooltip for text (links) to be highlighted in a literal on the page, and is tooltipified using a RadToolTipManager. In the main text, the HTML display is fine for the tooltip, but in the menu item, it all displays as plain text. The tooltipmanager has no Target Controls, just trying to have everything on the page present the same way but the menu items don't seem to be picked up.

Menu item text and tool tip text are both loaded from a SQL data source depending on other page selections, not hard coded into the radmenu control. It appears a blank tool tip is trying to come from the tooltipmanager on each radmenu item, but the non-tooltipified tool tip pops up with no skin formatting.

I have also tried a separate RadToolTip control just for the RadMenu control but no luck. Is there a TargetControlID such as MyMenu_Items that I should be using?

Thanks
Dave
David
Top achievements
Rank 1
 answered on 26 Jul 2012
3 answers
109 views
Hi,

I'm trying to insert/update values in an XML file using XMLDataSource and RadGrid. Below is my code :

aspx
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="XmlDataSource1"
        GridLines="None">
        <MasterTableView AutoGenerateColumns="False" DataSourceID="XmlDataSource1" EditMode="InPlace"
            CommandItemDisplay="Bottom" InsertItemDisplay="Bottom">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="ruleset_id" FilterControlAltText="Filter ruleset_id column"
                    HeaderText="ruleset_id" SortExpression="ruleset_id" UniqueName="ruleset_id">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn DataField="list_code" FilterControlAltText="Filter list_code column"
                    HeaderText="list_code" SortExpression="list_code" UniqueName="list_code">
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="ListCodeComboBox" runat="server" SelectedValue='<%# Bind("list_code") %>'>
                            <Items>
                                <telerik:RadComboBoxItem Text="BA001" Value="BA001" />
                                <telerik:RadComboBoxItem Text="BA002" Value="BA002" />
                                <telerik:RadComboBoxItem Text="BA003" Value="BA003" />
                            </Items>
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="list_codeLabel" runat="server" Text='<%# Eval("list_code") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="seq_no" FilterControlAltText="Filter seq_no column"
                    HeaderText="seq_no" SortExpression="seq_no" UniqueName="seq_no">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="new_field_name" FilterControlAltText="Filter new_field_name column"
                    HeaderText="new_field_name" SortExpression="new_field_name" UniqueName="new_field_name">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn DataField="field_name" FilterControlAltText="Filter field_name column"
                    HeaderText="Field Name" SortExpression="field_name" UniqueName="field_name">
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="FieldNameComboBox" runat="server" DataSourceID="XmlDataSource2"
                            DataTextField="field_name" DataValueField="field_length" AppendDataBoundItems="True">
                            <Items>
                                <telerik:RadComboBoxItem Text="Select" Value="" />
                            </Items>
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="field_nameLabel" runat="server" Text='<%# Eval("field_name") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="concat_constant_value" FilterControlAltText="Filter concat_constant_value column"
                    HeaderText="concat_constant_value" SortExpression="concat_constant_value" UniqueName="concat_constant_value">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="concat_substring_start_pos" FilterControlAltText="Filter concat_substring_start_pos column"
                    HeaderText="concat_substring_start_pos" SortExpression="concat_substring_start_pos"
                    UniqueName="concat_substring_start_pos">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="concat_substring_end_pos" FilterControlAltText="Filter concat_substring_end_pos column"
                    HeaderText="concat_substring_end_pos" SortExpression="concat_substring_end_pos"
                    UniqueName="concat_substring_end_pos">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="C:\TEMP\CONCATENATION_DETAIL_TEMP.XML">
    </asp:XmlDataSource>
    <asp:XmlDataSource ID="XmlDataSource2" runat="server" DataFile="C:\TEMP\LAYOUT_FIELDS_TABLE.XML"
        TransformFile="C:\TEMP\LAYOUT_FIELDS_TABLE.XSL"></asp:XmlDataSource>

aspx.vb
Private Sub RadGrid1_InsertCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand
    Dim ht As Hashtable = New Hashtable()
    DirectCast(e.Item, GridDataInsertItem).ExtractValues(ht)
    Dim s As String = ""
    For Each entry In ht
        s = s + "Field Name : " + entry.Key.ToString() + " , Value : " + entry.Value + vbCrLf
    Next
    MsgBox(s)
End Sub

output:
Field Name : concat_substring_start_pos , Value : 7
Field Name : concat_constant_value , Value : 6
Field Name : seq_no , Value : 3
Field Name : list_code , Value : BA002
Field Name : ruleset_id , Value : 1
Field Name : concat_substring_end_pos , Value : 8
Field Name : new_field_name , Value : 4  


I'm encountering 2 issues :
1. Column 5 (field_name), which is a template column that uses RadComboBox for editing and is bound to another data source for fetching values, is not extracted into the Hashtable.
2. Values in the hashtable are not in ordered in the sequence of RadGrid columns.

Please suggest the solutions for these (Issue 1 is higher priority)

Thanks,
Nishant
Eyup
Telerik team
 answered on 26 Jul 2012
0 answers
265 views
Hi,
I am using a grid to display data, it dynamically creating GridBoundColumn. I use System.Web.HttpUtility.HtmlEncode to encode the text, and when retrieving the data i use System.Web.HttpUtility.HtmlDecode to decode the data and then rebind to grid. When displaying the data in grid, it render the html. how can i display the data as text.

thanks in advance
Jiju
Jiju
Top achievements
Rank 1
 asked on 26 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?