Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
110 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
110 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
197 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
122 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
215 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
156 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
74 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
3 answers
130 views
hello telerik,
     sometimes we need to insert some emoticons to the text, although we can implement this function by customization, it is still inconvenient. why not add an embedded emoticon dropdownlist, and offer us a property to set a path which the folder contains the images we wanted, it's better that we can set a root folder, if it has sub-folder, it can be grouped automatically, Please see my attach image. thanks.

                                                                                                                                                                         
Rumen
Telerik team
 answered on 19 Apr 2011
3 answers
274 views
I'm using a RadGrid found in RadControls for ASPNET AJAX Q1 2008.

I've got alphanumeric data in a column that I need to sort via natural sort. Please look at this for better information about natural sort: http://www.codinghorror.com/blog/archives/001018.html

I tried getting it to work and I have been unsuccessful. Has anyone else tried implementing this in a RadGrid with out having to call the DB again?

Any suggestions are greatly appreciated.

Zack
Kent
Top achievements
Rank 1
 answered on 19 Apr 2011
2 answers
62 views
Hi, I was just wondering if it is possible to have a master detail relationship between radgrid and radchart.

I would like to display a piechart of data, however, it is likely that this pie chart may end up with a lot of records, so I would like the user to be able to select a record in a grid and this even to cause the chart to highlight or explode the corresponding segment of the piechart for that record.

Is this possible? If so, are there any examples I could look at or could be provided?

Thanks,
Matt

- Please ignore this, I found a solution
Evgenia
Telerik team
 answered on 19 Apr 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?