Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
124 views
Could you tell me why my code for RadGrid does not expand. It is very small but it has data in it. The only way I can expand it is to use with a meta tag and emulate IE7, but it is not what I want. 


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Grid.aspx.vb" Inherits="Grid.Grid" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
    <div>
    
    </div>
        <telerik:RadGrid runat="server" AutoGenerateColumns="False"
                    GridLines="None" Skin="Outlook" Height="95%" Width="98%" DataSourceID="SqlDataSource1">
                    <ClientSettings>
                        <Scrolling AllowScroll="False" UseStaticHeaders="True" ScrollHeight="200px" />
                    </ClientSettings>
                    <MasterTableView  TableLayout="Auto" Width="94%" DataSourceID="SqlDataSource1">
                        <RowIndicatorColumn Visible="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="False" Resizable="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="id" HeaderText="id" UniqueName="id" DataType="System.Int32" FilterControlAltText="Filter id column" SortExpression="id" >
<ColumnValidationSettings>
<ModelErrorMessage Text=""></ModelErrorMessage>
</ColumnValidationSettings>

                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="masterBatchNo" FilterControlAltText="Filter masterBatchNo column" HeaderText="masterBatchNo" SortExpression="masterBatchNo" UniqueName="masterBatchNo">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="processStage" FilterControlAltText="Filter processStage column" HeaderText="processStage" SortExpression="processStage" UniqueName="processStage">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings>
                            <PopUpSettings ScrollBars="None"></PopUpSettings>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                   
                </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:projectCopyConnectionString %>" SelectCommand="SELECT [id], [masterBatchNo], [processStage] FROM [PV_Batch]"></asp:SqlDataSource>
    </form>
</body>
</html>
Princy
Top achievements
Rank 2
 answered on 13 Jun 2014
2 answers
93 views
Dear Telerik,

Is it possible to have multiple x-axis label as described in attachment?

Much appreciate for any help.

Thanks!
Danail Vasilev
Telerik team
 answered on 13 Jun 2014
1 answer
129 views
We are getting this error and using Telerik dlls from GAC.  If I go to design mode in .aspx webform and I see the controls but on the page it throws this error.

Error:
http://screencast.com/t/ldNrMHAg

Web.config:
http://screencast.com/t/vIB40g9zxn

http://screencast.com/t/vIB40g9zxn

http://screencast.com/t/t6vqlpTWQv


Danail Vasilev
Telerik team
 answered on 13 Jun 2014
7 answers
129 views
Hi,

When reordering items, the text is not html-encoded correctly!

Sample:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="listbox.aspx.vb" Inherits="TestaTredjepartWeb.listbox" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title>Test</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <div>
            <telerik:RadListBox ID="rlb" runat="server" Width="330px" AllowReorder="true" EnableDragAndDrop="true">
                <Items>
                    <telerik:RadListBoxItem Text="<aaa>" />
                    <telerik:RadListBoxItem Text="<bbb>" />
                    <telerik:RadListBoxItem Text="<ccc>" />
                    <telerik:RadListBoxItem Text="<ddd>" />
                    <telerik:RadListBoxItem Text="<eee>" />
                    <telerik:RadListBoxItem Text="<fff>" />
                    <telerik:RadListBoxItem Text="<ggg>" />
                    <telerik:RadListBoxItem Text="<hhh>" />
                </Items>
            </telerik:RadListBox>
        </div>
    </form>
</body>
</html>

In the sample: try to reorder items, this makes the item text disappear!

Regards
Andreas
Boyan Dimitrov
Telerik team
 answered on 13 Jun 2014
4 answers
190 views
Hello
I am trying to autofill two of the many textboxes in my Radgrid. I want the first textbox to have the username of the logged on user and the other textbox should have current date and time.
With the help of another post I have managed this when creating a new record, but not when editing an existing record.
To be clear, if I edit an existing post I want the textboxes to have new values, current datetime and looged on user.
Here is my code:
Protected Sub RadGrid1_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
 
        If (e.CommandName = RadGrid.InitInsertCommandName) Then
            
            e.Canceled = True
            Dim loggedInUser = User.Identity.Name.ToString()
            Dim myDate As Date = Now()
            
            Dim defaultValue As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary()
            defaultValue("LastUpdated") = myDate.ToString()
            defaultValue("LastUpdatedBy") = loggedInUser.ToString()
            
            e.Item.OwnerTableView.InsertItem(defaultValue)
            End If
    End Sub


Thanks.
Anders
Top achievements
Rank 1
 answered on 13 Jun 2014
6 answers
2.1K+ views

ClientScript.RegisterStartupScript(

this.GetType(), "EnableCabType", "UncheckSelectAll('" + chkJobCategoryAll.ClientID + "','" + cblJobCategory.ClientID + "','" + cblCabinetType.ClientID + "','" + chkCabinetAll.ClientID + "');", true);

Seems the above script not at all fired in the ItemDataBound event of RadGrid's popup. Need this to be fired only from ItemDataBound

Any workarounds

Thanks

Regards
Raj

 

Princy
Top achievements
Rank 2
 answered on 13 Jun 2014
1 answer
103 views
I have a RadAjaxPanel that contains a table I am trying to update through the C# code. What happens is the user will first buy all the items, and click "Confirm Purchase". The original panel will go invisible, and then the final radajaxpanel will become visible. At that point, a method in C# will be called to populate the table inside with the final cart. However, in my C# code, when I try to add a newly created row to the table, I get an error that the table doesn't exist. Here's the code: <telerik:RadAjaxPanel ID="PanelCompletePurchase" runat="server" Visible="false">
    <h4>Complete Purchase</h4> 
    <table id="ReceiptTable">
        <tr>
           <th>Quantity</th>
           <th>Product</th>
           <th>Rate</th>
           <th>Price</th>
        </tr>
    </table>
    <asp:Label ID="Message" runat="server" ForeColor="Maroon"></asp:Label>
                <br />
                <asp:Label ID="Response" runat="server" ForeColor="maroon"></asp:Label>
                <br />
                <asp:Label ID="Debug" runat="server" forecolor="maroon"></asp:Label>
</telerik:RadAjaxPanel>

In my C# code, I doReceiptTable.Rows.Add(someCreatedRow);ReceiptTable is red and it shows unknown entity. How do I access the html table inside of the RadAjaxPanel? My Labels update just fine





Princy
Top achievements
Rank 2
 answered on 13 Jun 2014
2 answers
446 views
Why below code is not working. I am try to convert html to pdf. "radEditor.ExportToPdf()" line of code given error "Object reference not set to an instance of an object at Telerik.Web.UI.Editor.Export.RadEditorExportTemplate.Export()" 
       static void Main(string[] args)
        {
            RadEditor radEditor = new RadEditor();
            radEditor.Content = "<div>Hello</div>";
            radEditor.ExportContent += radEditor_ExportContent;
            radEditor.ExportToPdf();
        }

        static void radEditor_ExportContent(object sender, EditorExportingArgs e)
        {
            string path = "C:/tmp/NewFile.pdf";
            if (File.Exists(path))
            {
                File.Delete(path);
            }

            using (FileStream fs = File.Create(path))
            {
                Byte[] info = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
                fs.Write(info, 0, info.Length);
            }

        }
Ianko
Telerik team
 answered on 13 Jun 2014
4 answers
434 views
Hi

I have a fairly standard radgrid with masterview and detail tables.

When editing an item at the top level (parent item), how would I go about auto-expanding the child rows and putting the parent and child rows in edit mode?

Thanks
David
Anuja
Top achievements
Rank 1
 answered on 13 Jun 2014
3 answers
200 views
I have added a ComboBox control to the AdvancedForm.ascx.  When the advanced form is displayed, the selected item in the combobox is not shown.  Stepping through the code, I can see radDropDestination.SelectedIndex = dest.Index; properly being set.  How do you set the SelectedIndex for the ComboBox or properly bind the Combobox so the selected item is shown when the AdvancedForm.ascx is displayed?  


<telerik:RadComboBox ID="radDropDeparture" runat="server" Width="350px" EmptyMessage="-- Depart from ---" DataSourceID="DataSourceDeparture" DataTextField="DepartureName" DataValueField="Id" Skin="Glow" MaxHeight="300px" EnableAutomaticLoadOnDemand="false" EnableItemCaching="true"></telerik:RadComboBox>


Code behind for AdvancedForm.ascx

[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
      public string DestinationID
      {
          get
          {
              return radDropDestination.SelectedValue;
          }
 
          set
          {
                if (value == null)
                  return;
                radDropDestination.DataBind();
              RadComboBoxItem dest = radDropDestination.FindItemByValue(value);
              radDropDestination.SelectedIndex = dest.Index;
          }
      }

From the default.aspx

<AdvancedEditTemplate>
                  <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>'
                      Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
                      RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>'
                      DestinationID='<%# Bind("DestinationID") %>' DepartureID='<%# Bind("DepartureID") %>' />
              </AdvancedEditTemplate>

Michael
Top achievements
Rank 1
 answered on 13 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?