Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
Hello,

Attached is a screen shot of my page.
But what I am wanting to do, and I have not been able to do so.
Is when the user select a node from the treeview I want to display the appropriate grid.
For each node there is a new grid, and depending on which node they choose I want to show that grid, and hide the others.

I have each grid in a RadAjaxPanel, and I have tried setting visiblity to true and false for the panel, and or the grids but it does not seem to work.
I have also tried a snippet of code I found on these forums, but that too does not work for me.
 if (RadGridOSPProposal.Style["display"] != null && RadGridOSPProposal.Style["display"].ToString() == "none")
                    RadGridOSPProposal.Style["display"] = "";
                else
                    RadGridOSPProposal.Style.Add("display""none");  

Thanks for any help, code samples are alway welcome.
KS
Marin
Telerik team
 answered on 18 Mar 2011
1 answer
53 views
upon clicking an event from my monthview, I want to change the date of the dayview I have to that day. I have am trying to pass in the startdate from the database (i.e. dt.Rows[0]["startDate"].ToString()) to the DataStartField. Is there a different method to the madness? SelectedDate but that did not work either.

Thanks,
Mike

 

Peter
Telerik team
 answered on 18 Mar 2011
2 answers
74 views
Currently my schedular is readonly and only the date in the corner is clickable. How do I make the actual event clickable.
Also is there a way to make the entire square clickable as well?

Thanks
Peter
Telerik team
 answered on 18 Mar 2011
5 answers
295 views
Hi Telerik,

I'm using RadFileExplorer in this page

<!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">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server">
            <Configuration UploadPaths="/Uploads/examples" ViewPaths="/Uploads/examples" DeletePaths="/Uploads/examples"
                MaxUploadFileSize="2097151000"
                SearchPatterns=".jpg" />
        </telerik:RadFileExplorer>
    </div>
    </form>
</body>
</html>

I set SearchPatterns: ".jpg" or "jpg" but I couldn't upload that file with extension "jpg", Please help me
Dobromir
Telerik team
 answered on 18 Mar 2011
5 answers
327 views
Hello,

Refrering to my unanswered thread
http://www.telerik.com/community/forums/aspnet-ajax/compression/radhiddenfieldpagestatecompression-gzip.aspx

and now porting to .net 4.

Being unsure that I am obtaining compressed Viewstate (they are so big), I want to trace on server the fact that the that it is compressed, Fiddler or FireBug can't be used easilly on a production site.


Is there a way to activate some server side trace in Telerik tools or to trace thta Viewstate is going through my .browser file and the control adapter is effectivelly usefd.

Thanks
CS
Simon
Telerik team
 answered on 18 Mar 2011
4 answers
481 views
Outside of the scheduler, I'm trying to loop through all events in a given date range.  Due to the complexity of recurrence, I have a hidden instance of the RadScheduler on my form, and I am looping through the appointments and resources examining each appointment to see if it falls within range.  The process is not smooth.  I'm having lots of trouble with recurrence.  For example, if I select one date, I'm getting two copies of the same event...one with, say, an ID of 105, and the other with an ID of 105_0.  If I select a week, I am only seeing the 105_0 appointment.

I am finding work-arounds for each issue as I encounter one, but do not have faith that there aren't other hidden problems. Is there a better way to loop through by date range?  The code below is just my latest experimentation. I probably need to scrap and start over.

private void LoopEvents()
{
    RadListBox rlbResources = PanelBar.Items[0].Items[0].FindControl("rlbResources") as RadListBox;
    DataTable dt;
    string canceled = "Canceled";
 
    string sql = "SELECT * FROM AppointmentResource";
    string errString = "";
    DateTime currdt = Convert.ToDateTime("1/1/1901");
 
    dt = PageData.GetData(sql, ref errString).Tables[0];
    if (rlbResources.Items.Count == 0)
        rlbResources.DataBind();
 
    foreach (Telerik.Web.UI.RadDate rd in RadCalendar1.SelectedDates)
    {
        foreach (Telerik.Web.UI.Appointment a in RadScheduler1.Appointments)
        {
                foreach (Telerik.Web.UI.RadListBoxItem l in rlbResources.Items)
                {
                    if (l.Checked & a.Resources.GetResource("Resource", Convert.ToInt32(l.Value)) != null)
                    {
                         
                        //Occurrences of a recurrence master are not generated untill they
                        //are within RadScheduler's visible range. This mandates the occurrences
                        //information to be extracted from the Master's recurrence rule as follows:
                        if ((a.RecurrenceState == RecurrenceState.Master) & RadCalendar1.SelectedDates.Count > 1)
                        {
                            RecurrenceRule parsedRule;
                            RecurrenceRule.TryParse(a.RecurrenceRule.ToString(), out parsedRule);
 
                            //If a recurring appointment does not have specified end time it will have
                            //endless occurrences. In this case you can explicitly put a restriction:
 
                            if (RadCalendar1.SelectedDates.Count > 1)
                                parsedRule.SetEffectiveRange(RadCalendar1.SelectedDates[0].Date, RadCalendar1.SelectedDates[RadCalendar1.SelectedDates.Count - 1].Date);
                            else
                                parsedRule.SetEffectiveRange(RadCalendar1.SelectedDate.AddDays(-1), RadCalendar1.SelectedDate.AddDays(1));
                             
                            foreach (DateTime occurrence in parsedRule.Occurrences)
                            {
                                if (occurrence.ToShortDateString() == rd.Date.ToShortDateString())
                                {
                                        //We have a match
                                }
                            }
                        }
                        else //Get the rest of the appointments    
 
                            //If the SelectedDate of RadScheduler is set so that the visible range encompasses occurences of     
                            //a recurring appointement, these occurences will be generated now so they will be added once again    
                            //to the DataTable. To prevent this, we use the following check:    
                            //if (a.RecurrenceState != RecurrenceState.Occurrence)
                            //{
                            if (WithinDate(a.Start, a.End, rd.Date))
                            {
                                  //We have a match
                            }
                        //}
 
                    }
                }
        }
    }
 
}
Peter
Telerik team
 answered on 18 Mar 2011
2 answers
76 views
I'm trying to bind a rad grid from a custom datatable but I cannot get any of the data to show. I have read all your examples but still cannot seem to get it to work. Here's my code
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"
GridLines="None" ShowGroupPanel="True" AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource">
    <MasterTableView GridLines="None" Width="100%" CommandItemDisplay="Top">
        <Columns>
            <telerik:gridboundcolumn datafield="FirstName" headertext="First Name"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="LastName" headertext="Last Name"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Business Name" headertext="Business Name"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="State" headertext="State"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Zip" headertext="Zip"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Address" headertext="Address"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="City" headertext="City"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Phone" headertext="Phone"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Fax" headertext="Fax"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="CellPhone" headertext="Cell"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Eamil" headertext="Email"
            </telerik:gridboundcolumn>
            <telerik:gridboundcolumn datafield="Edit" headertext="Edit"
            </telerik:gridboundcolumn>
        </Columns>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="True">
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
</telerik:RadGrid>

VB
'this function gets the data for the rad grid
Private Function getData()
    Dim table As DataTable = New DataTable()
    table.Columns.Add("First Name")
    table.Columns.Add("Last Name")
    table.Columns.Add("Business Name")
    table.Columns.Add("State")
    table.Columns.Add("Zip")
    table.Columns.Add("Address")
    table.Columns.Add("City")
    table.Columns.Add("Phone")
    table.Columns.Add("Fax")
    table.Columns.Add("Email")
    table.Columns.Add("CellPhone")
    table.Columns.Add("Edit")
    'my sql connection
    Dim myConn As New Data.SqlClient.SqlConnection(conn)
 
    'the name of the stored procedure
    Dim strSQL = "getAllCustomers"
 
    'add the initial - Please Select -
    'table.Rows.Add(New String() {"-1", "- Please Select -"})
 
    Try
 
        myConn.Open()
        Dim readCommand As New Data.SqlClient.SqlCommand(strSQL, myConn)
 
        'while we have rows from the stored procedure
        'we will add them to a data table
        Dim cdr As SqlDataReader = readCommand.ExecuteReader()
        While cdr.Read()
 
            If (cdr.Item(0).ToString <> "") Then
 
                table.Rows.Add(New String() {cdr.Item(1), cdr.Item(2), cdr.Item(3), cdr.Item(4), cdr.Item(5), cdr.Item(6), cdr.Item(7), cdr.Item(8), cdr.Item(9), cdr.Item(10), cdr.Item("<a href='EditCustomer.aspx?id=" & cdr.Item(0) & "'>Edit</a>")})
 
            End If
 
        End While 'while cdr.Read()
 
    Catch ex As Exception
 
    End Try
    myConn.Close()
 
    Return table
 
End Function 'createTable
 
 
Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
    RadGrid1.DataSource = getData()
End Sub

Web Services
Top achievements
Rank 2
 answered on 18 Mar 2011
1 answer
100 views
I am using the file explorer to manage images inside of a folder, much like the demo application, with file preview. There are no sub-folders. 

My folder that contain images are named after the record id. This is not a good name for the top level folder for the customer to see. I would like for the root folder to always read "Images". Is it possible to have the root folder named something other than what is actually on the server, for the GUI portion only?

Thanks. 
Dobromir
Telerik team
 answered on 18 Mar 2011
7 answers
194 views
We noticed the following issue with IE9 RC.

When a RadGrid is in a table and with UseStaticHeaders set to true the rows are not displayed at all.

<table style="width:100%">
    <tr>
        <td>
            <telerik:RadGrid ID="grd" runat="server" Skin="Windows7" Width="100%" Height="120px"
                AutoGenerateColumns="false">
                <MasterTableView Width="100%" TableLayout="Fixed">
                    <Columns>
                        <telerik:GridTemplateColumn>
                            <HeaderStyle Width="50%" />
                            <HeaderTemplate>
                                <asp:Label ID="lblNameHeader" runat="server" Text="Name"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblName" runat="server" Text='<%#Eval("Name")%>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn>
                            <HeaderStyle Width="50%" />
                            <HeaderTemplate>
                                <asp:Label ID="lblSurnameHeader" runat="server" Text="Surname"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblSurname" runat="server" Text='<%#Eval("Surname")%>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="true" />
                    <Scrolling ScrollHeight="120px" AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </td>
    </tr>
</table>


Code Behind:
public partial class GridTest : System.Web.UI.Page
   {
       List<MyClass> lst = new List<MyClass>();
 
       protected void Page_Load(object sender, EventArgs e)
       {
           this.lst.Add(new MyClass("Andrew", "Dimech"));
           this.lst.Add(new MyClass("Rachel", "Smith"));
           this.lst.Add(new MyClass("James", "Black"));
 
           this.grd.DataSource = this.lst;
           this.grd.DataBind();
       }
   }
 
   public class MyClass
   {
       public MyClass(string name, string surname)
       {
           this.Name = name;
           this.Surname = surname;
       }
 
       private string name;
 
       public string Name
       {
           get { return name; }
           set { name = value; }
       }
 
       private string surname;
 
       public string Surname
       {
           get { return surname; }
           set { surname = value; }
       }
 
   }
Tsvetoslav
Telerik team
 answered on 18 Mar 2011
0 answers
195 views

Hi,

i have a grid with hyperlink column and which open the download.aspx page and file.
 <telerik:GridHyperLinkColumn
                                            DataNavigateUrlFields="FilePath" 
                                            DataTextField="FileName" 
                                            DataNavigateUrlFormatString="{0}" 
                                            Visible="true"
                                            HeaderText="File Name"
                                            Target="_blank"
                                            HeaderStyle-Width="300px"
                                        >
                                        </telerik:GridHyperLinkColumn>

now here "FilePath"  field is coming from db which is as follow...Test&Doc
but the querystring passing to downlaod.aspx page is only Test
i cannot able to do HttpUtility.UrlEncode as it is not supported.

if i write the column as  DataNavigateUrlFields=HttpUtility.UrlEncode("FilePath")

it gives error and not working,....


please help.


bharat kumar
Top achievements
Rank 1
 asked on 18 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?