Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
190 views
Hi, I have a dynamically created grid on page_init as you show in your demos.  I would like to know if there is any difference between setting the Grid.DataSource when the Grid is created on Page_Init and setting the DataSource on the NeedDataSource event of the grid.  I ask this because I noticed that the grid always calls the NeedDataSource event as opposed to if the grid was created declaratively in the page.

Any help would be greatly appreciated,
Manuel
Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Jul 2011
1 answer
163 views
Hey,
I'm working on a fileExplorer control which explores directory on a different drive than the project's drive, so I'll need to use virtual directory, please can you help me in doing this? I've created a virtual directory in IIS, but I don't know what to do next?what's the appropriate syntax?
Dobromir
Telerik team
 answered on 18 Jul 2011
1 answer
101 views
 I want to show the time not specific time, but range time, for example: 8:00- 10:00(please see the attached picture),
So I change the timpicker format:

  RadTimePickerVisitTime.Culture = new System.Globalization.CultureInfo("en-US")
                {
                    DateTimeFormat = new System.Globalization.DateTimeFormatInfo
                    {
                        ShortTimePattern = "HH:00-HH:00" , // In case of DisplayFormat="Short"
                        LongTimePattern = "HH:00-HH:00"  // In case of DisplayFormat="long"
                    }
                };

also I change the data show in timepicker:

protected void RadTimePickerVisitTime_ItemDataBound(object sender, TimePickerEventArgs e)
        {
           if ((e.Item.ItemType == ListItemType.Item)|| (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                System.Data.DataRowView dataItem = (System.Data.DataRowView)e.Item.DataItem;
                DateTime boundTime = (DateTime)dataItem.Row["Time"];
                var first = boundTime.Hour + ":00-";
                var second = boundTime.AddHours(2).Hour + ":00";
               System.Globalization.CultureInfo  culture =  new System.Globalization.CultureInfo("en-US")
                {
                    DateTimeFormat = new System.Globalization.DateTimeFormatInfo
                    {
                        ShortTimePattern = "HH:00-HH:00", // In case of DisplayFormat="Short"
                        LongTimePattern = "HH:00-HH:00"  // In case of DisplayFormat="long"
                    }
                };
               boundTime = DateTime.Parse(first + second, culture);
            }
        }

But it not work, anyone can give me some suggestion, thanks a lot!!!!
Vasil
Telerik team
 answered on 18 Jul 2011
8 answers
194 views
Hello All,

  I exported the telerik grid to excel by using the command below

RadGrid_DetailsView.MasterTableView.ExportToExcel();

I want to set the header on each page that says
"This is the DRAFT Data".

How can I accomplish that.

Thanks.

Daniel
Telerik team
 answered on 18 Jul 2011
1 answer
66 views
Hi,
 I am using two grid and some controls on the page but. Now I am getting a problem on the page and that is if i click on page anywhere than it shows alert to delete record. i am using

  <telerik:GridButtonColumn
                                ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="System Message" ButtonType="ImageButton"
                                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                                <HeaderStyle Width="20px" />
                            </telerik:GridButtonColumn>


as a delete column. Please help me to resolve this problem.

Thanks
Manish.
Andrey
Telerik team
 answered on 18 Jul 2011
4 answers
173 views
Hi forum!

i'm having some trouble making a combobox select an item knowing its value. I've seen demos and documentation and i cloned the examples but its not working for me. I don't know what im doing wrong.

 When i select an item from my combobox1, even in the RadComboBox1_SelectedIndexChanged the selectedIndex is always = -1 so this way i can't know the index of the item and use it for other things.
So to try and selecte an item in the radcombobox2 i go for the value of the item selected in the radcombobox1. This value comes right but when i try RadComboBox2.SelectedIndex = RadComboBox2.FindItemIndexByValue(boletim_id) the index i receive from the find method is -1 and i know that exists an item with the boletim_id value in the radcombobox2 because the datasource in both radcombobox is the same. The same will happen if i try the finditemindexbytext or finditembyvalue or finditembytext.

File Code (ASP)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <div>
      
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Processos8ConnectionString %>" 
            SelectCommand="SELECT [Sinistrado], [Sinistrado_ID] FROM [Sinistrados]">
        </asp:SqlDataSource>
      
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Processos8ConnectionString %>" 
            SelectCommand="SELECT [Sinistrado_ID], [Sinistro_ID], [Tomador_ID], [Boletim_id] FROM [Boletins]">
        </asp:SqlDataSource>
          
      
    </div>
    <telerik:RadComboBox ID="RadComboBox1" Runat="server" 
        DataSourceID="SqlDataSource1" DataTextField="Sinistrado" 
        DataValueField="Sinistrado_ID" AllowCustomText="True" 
        AutoCompleteSeparator="|" AutoPostBack="True" ItemsPerRequest="20" 
        MarkFirstMatch="True" ShowMoreResultsBox="True" 
        EnableAutomaticLoadOnDemand="True">
    </telerik:RadComboBox>
    <telerik:RadTextBox ID="RadTextBox1" Runat="server">
    </telerik:RadTextBox>
    <telerik:RadTextBox ID="RadTextBox2" Runat="server">
    </telerik:RadTextBox>
    <telerik:RadComboBox ID="RadComboBox2" Runat="server" 
        DataSourceID="SqlDataSource1" DataTextField="Sinistrado" 
        DataValueField="Sinistrado_ID" AllowCustomText="True" 
        AutoCompleteSeparator="|" AutoPostBack="True" ItemsPerRequest="20" 
        MarkFirstMatch="True" ShowMoreResultsBox="True" 
        EnableAutomaticLoadOnDemand="True">
    </telerik:RadComboBox>
    <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" 
            DataSourceID="SqlDataSource2" GridLines="None" 
        AutoGenerateColumns="False">
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
  
<MasterTableView datakeynames="Boletim_id" 
                datasourceid="SqlDataSource2">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
  
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
  
    <Columns>
        <telerik:GridButtonColumn Text="Select" CommandName="Select" ButtonType="ImageButton" ImageUrl="~/images/select_16_mouse.png">
        </telerik:GridButtonColumn>
        <telerik:GridBoundColumn DataField="Sinistrado_ID" DataType="System.Int32" 
            FilterControlAltText="Filter Sinistrado_ID column" HeaderText="Sinistrado_ID" 
            SortExpression="Sinistrado_ID" UniqueName="Sinistrado_ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Sinistro_ID" DataType="System.Int32" 
            FilterControlAltText="Filter Sinistro_ID column" HeaderText="Sinistro_ID" 
            SortExpression="Sinistro_ID" UniqueName="Sinistro_ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Tomador_ID" DataType="System.Int32" 
            FilterControlAltText="Filter Tomador_ID column" HeaderText="Tomador_ID" 
            SortExpression="Tomador_ID" UniqueName="Tomador_ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Boletim_id" DataType="System.Int32" 
            FilterControlAltText="Filter Boletim_id column" HeaderText="Boletim_id" 
            ReadOnly="True" SortExpression="Boletim_id" UniqueName="Boletim_id">
        </telerik:GridBoundColumn>
    </Columns>
  
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
  
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
  
<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
      
    </form>
</body>
</html>

File Code(VB.NET)
Imports Telerik.Web.UI
Imports System.IO
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Data
Imports System.Net
Partial Class _Default
    Inherits System.Web.UI.Page
  
    Protected Sub RadComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
        SqlDataSource2.SelectCommand = "SELECT [Sinistrado_ID], [Sinistro_ID], [Tomador_ID], [Boletim_id] FROM [Boletins] WHERE SINISTRADO_ID = " & RadComboBox1.SelectedValue
        RadGrid1.DataBind()
        RadComboBox1.SelectedIndex = RadComboBox1.SelectedIndex
    End Sub
  
    Protected Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged
        Dim boletim_id As String = DirectCast(RadGrid1.SelectedItems.Item(0), GridDataItem).Cells(6).Text.ToString
        RadTextBox1.Text = DirectCast(RadGrid1.SelectedItems.Item(0), GridDataItem).Cells(5).Text.ToString
        RadTextBox2.Text = DirectCast(RadGrid1.SelectedItems.Item(0), GridDataItem).Cells(4).Text.ToString
        Dim x As Integer = RadComboBox2.FindItemIndexByValue(boletim_id)
        'Dim z As Integer = RadComboBox1.SelectedItem.Index
        RadComboBox1.Text = ""
        RadComboBox1.SelectedValue = ""
        RadComboBox2.SelectedIndex = RadComboBox2.FindItemIndexByValue(boletim_id)
        RadComboBox2.SelectedIndex = RadComboBox1.SelectedItem.Index
    End Sub
End Class


Many Thanks,
FEST
Dimitar Terziev
Telerik team
 answered on 18 Jul 2011
4 answers
165 views
Hi,

I want to create a grid as attached in the image.
As you can see I have rowspan set to first 2 columns of the grid. I am setting the rowspan by comparing the column value in row and previous row, and by combining the rows. So i am able to achieve the first part.
columns country, currency, col3,col4,col5 are declared statically in aspx page. so far so good.
I have random number of contact columns (in turn divided into 3 columns). I want to add these columns to Grid in code-behind. I checd in the documentation of grid and it says

RadGrid does not support mixing declarative grid columns with grid columns added dynamically at runtime. You should either create all the columns in the grid programmatically, or else define them all in the ASPX file.

How to further build the Grid?

Thanks
Teldev




Iana Tsolova
Telerik team
 answered on 18 Jul 2011
2 answers
98 views

Hi,

 

I am getting the formatting problem in RADGRID. the header columns are not getting aligned with the code.

Kindly, see the below code and suggest a solution:

 <rad:radgrid id="rgvCRSummary" runat="server" gridlines="both" height="115px" isdynamic="False"
                                                    skin="Master" skinspath="~/App_Themes/MasterTheme/Skins" width="100%">
 <HeaderStyle CssClass="Grid_headerHP" />
 <ItemStyle CssClass="Grid_ItemHP"  />
<AlternatingItemStyle CssClass="Grid_ItemHP"  /> 
<SelectedItemStyle  CssClass="Grid_SelectedHP" /> 
<MasterTableView EnableColumnsViewState="true" TableLayout="Fixed" Width="100%">
<Columns>
<rad:GridBoundColumn DataField="heading" UniqueName="heading" DataFormatString = "<nobr>{0}</nobr>"><HeaderStyle Width="30%" /></rad:GridBoundColumn>
<rad:GridBoundColumn DataField="sales_pos" HeaderText="<nobr>Sales Position</nobr>" UniqueName="sales_pos" DataFormatString = "<nobr>{0}</nobr>"></rad:GridBoundColumn>
<rad:GridBoundColumn DataField="Geo" HeaderText="Geography" UniqueName="Geo" DataFormatString = "<nobr>{0}</nobr>"></rad:GridBoundColumn>
<rad:GridBoundColumn DataField="Acc" HeaderText="Account" UniqueName="Acc" DataFormatString = "<nobr>{0}</nobr>"></rad:GridBoundColumn>
<rad:GridBoundColumn DataField="Presc" HeaderText="Prescriber" UniqueName="Presc" DataFormatString = "<nobr>{0}</nobr>"></rad:GridBoundColumn>
</Columns>
</MasterTableView>
</rad:radgrid>

Please find the attached file as my web page having RadGrid.
I am using the  radgrid version 5.1.1.0 and IE8 as my web browser.
Please suggest me how can we resolve with this misalignment of column with this version.

Thanks,
Manoj Singh

 

Iana Tsolova
Telerik team
 answered on 18 Jul 2011
4 answers
806 views

Hi ,

My asp.net page contains a radscheduler , whenever I view this page I get the following error.

System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.

   at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)

   at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)

   at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
   at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo)

   at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
   at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Craig Wallace
Top achievements
Rank 1
 answered on 18 Jul 2011
1 answer
93 views
Hi,

Is it possible to export two radgrid in 1 pdf /excel file?


Thanks,
Bermo
Princy
Top achievements
Rank 2
 answered on 18 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?