Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
148 views
I have a GridTemplateColumn that displays 3 columns of data - Parent/Child relationship with the current row.  I need to be able to filter on any of the three columns.

I can create a FilterTemplate that displays 3 textboxes in the FilterCell to match up with the 3 columns of data.  But I can't get the GridFilterMenu to attach to the textboxes.  The example for  the MS DropDownlist customization is sort of what I'm trying to do (http://www.telerik.com/help/aspnet-ajax/grdoperationswithdropdownlistinedititemtemplate.html).  But that is based on a single column of data.

Any ideas of how I can expand this to incorporate all the textboxes in the filter template?

Thanks
Martin
Telerik team
 answered on 19 Apr 2011
1 answer
69 views
Hello,

I need to specify the table name in my custom field editor and when I do it's formatting the results in a way I do not want. When I set FieldName = [TableName].[FieldName] my result is returned [[TableName].[FieldName]] = 12345. Is there a way I can suppress the formatting of the result so I can control the outcome?

Thanks!

Don
Radoslav
Telerik team
 answered on 19 Apr 2011
2 answers
94 views
Hi;
We are using RadTreeView and RadListBox . We have a unusal requirement Considering a scenario we want to use RadTreeView on Left Hand Side and RadListBox on RigthHandside and using Drag and drop mechanism of Telerik control we want to Transfer data from Left hand side to Right hand side ie from TreeView control to ListBox and Viseversa.
We have tried this but our problem was that we were not able to get Serverside Events when we transfer from TreeView control to ListBox control event like "OnNodeDrop".
Can you please tell us how we can able to achive this functionality.
Please Let us know ASAP
Genady Sergeev
Telerik team
 answered on 19 Apr 2011
4 answers
120 views
Hello,

I am trying to do some manual form processing from the Template form with simple text boxes. I have followed several documented examples and I am not getting any values back from my posted form. Can anybody help me understand what might be wrong here?

I would like to do some basic processing like this:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/manual-insert-update-delete-using-formtemplate-and-sql-backend.aspx

I am using a custom business object to interface with my database and all I want to do is populate the object from the form values and call a procedure to handle the data processing on the backend. Simple enough right?

Protected Sub gridAdjustments_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
        Try
            Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
            Dim thisAdjustmentDetail As New AdjustmentDetail()          

            thisAdjustmentDetail.ChangedSSN = (TryCast(insertedItem.FindControl("txtSSN"), TextBox)).Text
            thisAdjustmentDetail.FirstName = (TryCast(insertedItem.FindControl("txtFirstName"), TextBox)).Text
            thisAdjustmentDetail.MiddleName = (TryCast(insertedItem.FindControl("txtMiddleName"), TextBox)).Text
            thisAdjustmentDetail.LastName = (TryCast(insertedItem.FindControl("txtLastName"), TextBox)).Text
            Dim qtrlyEarnings As String = (TryCast(insertedItem.FindControl("txtQuarterlyEarnings"), TextBox)).Text
            If qtrlyEarnings <> "" Then
                thisAdjustmentDetail.QuarterlyEarnings = Decimal.Parse(qtrlyEarnings)
            Else
                thisAdjustmentDetail.QuarterlyEarnings = 0D
            End If

            Dim insertDetailRecord As New DetailTable()
            insertDetailRecord.InsertDetail(thisAdjustmentDetail)
 
            thisAdjustmentDetail = Nothing
            insertDetailRecord = Nothing
        Catch ex As Exception
            gridAdjustments.Controls.Add(New LiteralControl("Unable to insert item: " + ex.Message))
            e.Canceled = True
        End Try
    End Sub

Any of the statements where I do the TryCast to grab the values from the EditForm return empty values. I am probably missing something obvious, so I hope you can help.

Thanks in advance,
Mike
Tsvetina
Telerik team
 answered on 19 Apr 2011
1 answer
114 views
Is it possible?

In other words, instead of using the Sharepoint list grid, is there any way to use the RadGrid instead?

Thanks,
Joshua
Sebastian
Telerik team
 answered on 19 Apr 2011
2 answers
203 views
I have a RadRotator with RotatorType = "CoverFlow". It's width is set to 100%. I used the following code to resize it but it gives me the error: "Microsoft JScript runtime error: Object doesn't support this property or method" on rotatorElement.RadResize();  

var RadRotator1=<%= Rttr.ClientID %>;   
  window.onresize=function() 
  {   
     var rotatorElement = document.getElementById("<%= Rttr.ClientID %>");     
      rotatorElement.RadResize();   
   }

This is my ASPX code:

<table cellspacing="0" cellpadding="0" width="100%" style="table-layout: fixed">
        <tr>
            <td align="left">
                <telerik:RadRotator ID="Rttr" runat="server" Width="100%" ItemWidth="225" ScrollDirection="Left"
                    Height="285px" ItemHeight="165" ScrollDuration="500" FrameDuration="2000" RotatorType="FromCode"
                    InitialItemIndex="4" OnClientItemShown="OnClientItemShown" OnClientItemClicked="OnClientItemClicked"
                    CssClass="RemoveRotatorBorder">
                    <ItemTemplate>
                        <asp:Image ID="img1" runat="server" />
                    </ItemTemplate>
                </telerik:RadRotator>
                <telerik:RadCodeBlock ID="block1" runat="server">
                    <script type="text/javascript">
                        Telerik.Web.UI.RadRotatorAnimation.set_scrollAnimationOptions("<%= Rttr.ClientID %>",
                                            {
                                                reflectionHeight: 0.5, // The height of the reflection
                                                reflectionOpacity: 0.25
                                            }
                                        );
                    </script>
                </telerik:RadCodeBlock>
            </td>
        </tr>
    </table>

Can you please let me know what am I doing wrong and what can be done to fix the resizing issue??
Effat
Top achievements
Rank 1
 answered on 19 Apr 2011
5 answers
132 views
Hi,
My client want to validate (required field)  for RadHtmlField. But I saw the generated html by RadHtmlField so complex (there are a lot tag span, div, table inside each other). Is there a way to get value of RadHtmlField using javascript?
I appreciate your help.
Thanks.
Stanimir
Telerik team
 answered on 19 Apr 2011
4 answers
227 views
the text inside the radtooltip almost touches the border. How do I add either margin inside or some padding?
Svetlina Anati
Telerik team
 answered on 19 Apr 2011
4 answers
169 views
Morning,
My foreign key columns are not filtering.
I get this error: "Expression expected".
Furthermore none of the foreign key columns have the "Contains" filter option.
The WebsiteUrl column has "Contains" filter option and works perfectly.

My columns look like this:
        <telerik:GridBoundColumn DataField="WebsiteId" DataType="System.Int64"  
            EmptyDataText="&amp;nbsp;" HeaderText="WebsiteId" ReadOnly="True"  
            SortExpression="WebsiteId" UniqueName="WebsiteId" Visible="false" ForceExtractValue="InEditMode"
        </telerik:GridBoundColumn> 
         
        <telerik:GridBoundColumn DataField="WebsiteUrl" EmptyDataText="&amp;nbsp;"  
            HeaderText="WebsiteUrl" SortExpression="WebsiteUrl" UniqueName="WebsiteUrl"
        </telerik:GridBoundColumn> 
                 
            <telerik:GridTemplateColumn HeaderText="Client" 
                DataType="System.Int64" UniqueName="Client" > 
                    <EditItemTemplate> 
                        <telerik:RadComboBox ID="RadComboBoxClientName" Runat="server"  
                            DataSourceID="LinqDataSourceClient" DataTextField="ClientName"  
                            DataValueField="ClientId" SelectedValue='<%# Bind("ClientId") %>'  
                            Skin="Vista" Width="280px"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </telerik:RadComboBox>                         
                    </EditItemTemplate> 
                     
                    <ItemTemplate> 
                         
                        <asp:Label ID="LabelClientName" runat="server" Text<%#Eval("tblClient.ClientName")%>         > </asp:Label> 
                         
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>         
        
            <telerik:GridTemplateColumn HeaderText="Server" 
                DataType="System.Int32" UniqueName="Server"  > 
                    <EditItemTemplate> 
                        <telerik:RadComboBox ID="RadComboBoxServerName" Runat="server"  
                            DataSourceID="LinqDataSourceServer" DataTextField="ServerName"  
                            DataValueField="ServerId" SelectedValue='<%# Bind("ServerId") %>'  
                            Skin="Vista" Width="280px"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </telerik:RadComboBox>                         
                    </EditItemTemplate> 
                     
                    <ItemTemplate> 
                         
                        <asp:Label ID="LabelServerName" runat="server" Text<%#Eval("tblServer.ServerName")%></asp:Label> 
                         
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>            
         
 
        <telerik:GridBoundColumn DataField="LogFilePath" EmptyDataText="&amp;nbsp;"  
            HeaderText="LogFilePath" SortExpression="LogFilePath"  
            UniqueName="LogFilePath" Display="False"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="BandWidthCost" DataType="System.Decimal"  
            EmptyDataText="&amp;nbsp;" HeaderText="BandWidthCost"  
            SortExpression="BandWidthCost" UniqueName="BandWidthCost" Visible="false"
        </telerik:GridBoundColumn> 
I've Specified the filter menu manually like this:
    protected void RadGrid1_Init(object sender, EventArgs e) 
    { 
 
        GridFilterMenu menu = RadGrid1.FilterMenu; 
        int i = 0; 
        while (i < menu.Items.Count) 
        { 
            if (menu.Items[i].Text == "NoFilter" || 
               menu.Items[i].Text == "Contains" || 
               menu.Items[i].Text == "EqualTo" || 
               menu.Items[i].Text == "GreaterThan" || 
               menu.Items[i].Text == "LessThan"
            { 
                i++; 
            } 
            else 
            { 
                menu.Items.RemoveAt(i); 
            } 
        } 
 
    } 

Martin
Telerik team
 answered on 19 Apr 2011
1 answer
86 views
Hello.

I need to add a drop-down column to RadGrid  at Page_Load.
I have SQLDataSource in ASP.

C# code:
GridDropDownColumn ddColumn = new GridDropDownColumn();
RadGridTable.MasterTableView.Columns.Add(ddColumn);
ddColumn.DataSourceID = "LookupDS";
ddColumn.DataField = "table_name";
ddColumn.ListValueField = "id";
ddColumn.ListTextField = "name";

Everything works fine with SQL statement:
SELECT s.name AS id, s.name AS name
FROM sys.sysobjects s LEFT JOIN org_menu m ON (s.name=m.table_name)
WHERE (s.xtype='U') ORDER BY s.id

Then I slightly modify SQL to skip existing tables:
SELECT s.name AS id, s.name AS name
FROM sys.sysobjects s LEFT JOIN org_menu m ON (s.name=m.table_name)
WHERE ( (s.xtype='U') AND ( m.table_name IS NULL ) ) ORDER BY s.id

Now in that specific grid column all cells are empty.
However if I open row in editor the value shows up (in editor).

I checked SQL statements in management studio - both work fine.
The only difference is that the first returns more rows.

Any suggestions?
Radoslav
Telerik team
 answered on 19 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?