Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
102 views
Hi I have looked at the code demos and looked at the calendar sample site and would like to know why the function that i'm trying to loosely base on day render function doesn't want to work this is my code
  TableCell currentCell = new TableCell();  
            RadCalendarDay day = new RadCalendarDay(RadCalendar1);  
            MonthView view = new MonthView(RadCalendar1);  
 
            Telerik.Web.UI.Calendar.DayRenderEventArgs e = new Telerik.Web.UI.Calendar.DayRenderEventArgs(currentCell, day,view);  
 
            DateTime CurrentDate = RadCalendar1.SelectedDate;  
            backgroundColor1 = Color.Red.Name;  
            backgroundColor = Color.Green.Name;            
 
            currentCell = e.Cell;  
            currentCell.Style["background-color"] = backgroundColor;  
 
            string Connection = "Data Source=62.197.41.101; Initial Catalog=PilotWebApp; User ID=sa; Pwd=medularis;";  
 
            SqlConnection conn = new SqlConnection(Connection);  
            SqlCommand cmd = new SqlCommand("Slot_sp_EngineerTimeslots_Group", conn);  
            cmd.CommandType = CommandType.StoredProcedure;  
            cmd.Parameters.AddWithValue("@PROPREF", strPropref);  
            cmd.Parameters.AddWithValue("@PRIORITYCODE", PRIORITYCODE);  
            cmd.Parameters.AddWithValue("@JOBLENGTH""30");  
            cmd.Parameters.AddWithValue("@TIMESLOT""AT");  
            conn.Open();  
            SqlDataReader reader = cmd.ExecuteReader();  
            DataTable dt = new DataTable();  
            dt.Load(reader);  
            DayOfMonth = DateTime.Today.Day;  
 
            int rows = dt.Rows.Count;  
            endDate = RadCalendar1.SelectedDate.AddDays(rows);  
 
            foreach (DataRow dr1 in dt.Rows)  
            {  
                startDate = DateTime.Parse(dr1["BookedDate"].ToString());  
 
                if (CurrentDate >= startDate.Date && CurrentDate <= endDate.Date)   
                {  
                    Label label = new Label();  
                    label.Text = e.Day.Date.Day.ToString();  
                    label.BackColor = System.Drawing.Color.Green;  
                    e.Cell.Controls.Add(label);  
 
                    // disable the selection for the specific day  
                    RadCalendarDay calendarDay = new RadCalendarDay();  
                    calendarDay.Date = CurrentDate;  
                    calendarDay.IsSelectable = true;  
                    RadCalendar1.SpecialDays.Add(calendarDay);  
                }  
                CurrentDate.AddDays(1);  
            } 

what i need it do do is colour the cells that dont fit into the if statement red is there anything that i can do?
Kevin
Top achievements
Rank 1
 answered on 22 Jun 2009
1 answer
99 views
I have read in RadControlsAJAXCourseware.pdf that I can do text-wrapping manually using style="white-space: normal;" for a node with long text.
How can I do that in the code behind for all nodes (checking with a loop for example every node text if it is beyond a specific length and applying the style).
Thank you very much!
Stavros
Top achievements
Rank 1
 answered on 22 Jun 2009
2 answers
173 views

Hey!

I have a RadGrid that performs a CallBack on Update and Insert. The Code is executed correctly and the Item is updated/inserted in my Collection but on the Client the RadGridItem stays in EditMode. I tried setting item.Edit = "false" at the end of my Insert/Update Method but this did not work and threw an exception.

I'm confused because I thought the default behaviour was for the Item to close after editing. Am I missing something in my RadGrid configuration?

<telerik:RadGrid ID="gridVariables" runat="server" GridLines="None" AllowPaging="True" 
                            AllowSorting="true" CssClass="evaluation_grid" AllowMultiRowEdit="false" 
                            meta:resourcekey="gridVariables" 
                            onneeddatasource="gridVariables_NeedDataSource"   
                            Skin="<%# RadSkin %>" 
                            onupdatecommand="gridVariables_UpdateCommand" 
                            OnItemDataBound="gridVariables_ItemDataBound" 
                            ondeletecommand="gridVariables_DeleteCommand" 
                            oninsertcommand="gridVariables_InsertCommand" 
                            oncancelcommand="gridVariables_CancelCommand" 
                            AllowAutomaticUpdates="true" AllowAutomaticInserts="true" AllowAutomaticDeletes="true" 
                            PageSize="10" > 
                        <PagerStyle Mode="NextPrevAndNumeric" /> 
                        <ValidationSettings EnableValidation="false" /> 
                        <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" TableLayout="Fixed" DataKeyNames="Id" ClientDataKeyNames="Id, Shortname" CommandItemDisplay="Top">  
                            <Columns> 
                                <telerik:GridBoundColumn UniqueName="Id"  DataField="Id" Visible="false">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="ShortnameColumn"  DataField="Shortname"   
                                        meta:resourcekey="gbcShortname">  
                                        <HeaderStyle Width="70px"/>  
                                </telerik:GridBoundColumn> 
                                <telerik:GridTemplateColumn UniqueName="NameColumn"    
                                        meta:resourcekey="gbcName">  
                                    <ItemTemplate> 
                                        <p> 
                                            <%# Eval("Name")%> 
                                        </p> 
                                    </ItemTemplate> 
                                    <EditItemTemplate> 
                                        <asp:TextBox ID="txtName" Width="90%" Enabled="false" runat="server" Text='<%# Bind("Name") %>' /> 
                                    </EditItemTemplate> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridBoundColumn UniqueName="DescriptionColumn"  DataField="Description"   
                                        meta:resourcekey="gbcDescription">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="UnitColumn" DataField="Unit"   
                                        meta:resourcekey="gbcUnit">  
                                        <HeaderStyle Width="70px"/>  
                                </telerik:GridBoundColumn> 
                                <telerik:GridTemplateColumn UniqueName="ChangeAttributeColumn">  
                                    <HeaderStyle Width="30px"/>  
                                    <ItemTemplate> 
                                        <asp:ImageButton ID="btnChangeAttribute" runat="server" BorderWidth="1" CommandArgument='<%# Eval("Shortname") %>' ImageUrl="~/Img/change.gif" meta:resourcekey="btnChangeAttribute" OnPreRender="btnChangeAttribute_PreRender" /> 
                                    </ItemTemplate> 
                                    <EditItemTemplate> 
                                          
                                    </EditItemTemplate> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridEditCommandColumn CancelImageUrl="~/Img/Cancel_red.gif"   
                                EditImageUrl="~/Img/Edit.gif" 
                                UniqueName="EditColumn"   
                                UpdateImageUrl="~/Img/Update.gif"   
                                ButtonType="ImageButton" 
                                meta:resourcekey="vrEditColumn">  
                                <HeaderStyle Width="50px" /> 
                                </telerik:GridEditCommandColumn> 
                                <telerik:GridButtonColumn UniqueName="DeleteColumn" CommandName="Delete" ButtonType="ImageButton">  
                                    <HeaderStyle Width="30px"/>  
                                </telerik:GridButtonColumn> 
                            </Columns> 
                            <CommandItemTemplate> 
                                <div style="padding:10px 0px;">  
                                    <asp:ImageButton Text="Neu" meta:resourcekey="newValueColumn" 
                                        ID="btnNew" runat="server" CommandName="InitInsert" ImageAlign="Left" ImageUrl="~/Img/New.gif" 
                                        CausesValidation="false" OnPreRender="btnNew_PreRender" 
                                        Visible='<%# !gridVariables.MasterTableView.IsItemInserted %>' /> 
                                    <asp:LinkButton ID="btnNewVariable" CommandName="InitInsert" OnPreRender="btnNewVariable_PreRender" Visible='<%# !gridVariables.MasterTableView.IsItemInserted %>' CausesValidation="false" runat="server" Height="18px" meta:resourcekey="newValueColumn" /> 
                                </div> 
                            </CommandItemTemplate> 
                        </MasterTableView> 
                        <ClientSettings>    
                            <ClientEvents OnRowDblClick="rowDoubleClick" />    
                            <Selecting AllowRowSelect="True"></Selecting> 
                        </ClientSettings> 
                    </telerik:RadGrid> 
Peter
Top achievements
Rank 1
 answered on 22 Jun 2009
2 answers
64 views
Hello,

My code has not changed and I have just noticed a pb appeared since v 527 clientside:
when I do a select in the tree inside combo, the selected value goes normally in combo and combo close its panel, but if I try to open again the combo, there is no treeview displayed. Gone ?
The selected value is still Ok....but users have only one try, no morechance to change their mind .....very selective.

Thanks for a solution.

CS
CSurieux
Top achievements
Rank 2
 answered on 22 Jun 2009
1 answer
94 views
Hi.

First at all i describe my scenario.

I have a rad tabstrip with 2 tabs tied to a multipage control with 2 pages.

In the multiplage control i have:

in page 1 is contained a rad grid with sorting and paging but using onneed_datasource event handler and a 100 records page limit

in page 2 i have a html table with a button.

The problem.
when the page first load, i can see both the grid in page1 and the table in page2 when i click each tab in the parent control, but ......

if i click in the grid's pager the "4" to go to the grid's page 4,   ( record 301 to 400),
the grid show accurately its 4th page  ( record 301 to 400) but the multipage control loses the table and button in its page2,
instead of it i see again the grid, i mean doesnt matter what tab i click, i always see the grid

Any lead of solution for this ?.

Thx

Lester

Paul
Telerik team
 answered on 22 Jun 2009
1 answer
74 views
Hi,

Iam using the RadGrid with Hireachy. On the RadGrid i have the Buttons Export to Excel and Export to PDF on the top of the Grid.Iam using the Display on top Property to display the buttons. Export to exel is working but Export to PDF iam getting a blank Page.

Can any one pls let me know how to solve this issue.

Iam uisng the License verison of the Telerik.

Regards
asra
Pavlina
Telerik team
 answered on 22 Jun 2009
1 answer
96 views
Hi Dear all,
I am using r.a.d.controls Q4 2006 ASP.NET 2.x  in my projects.
Now i need a editable grid for my project.
I saw a editable grid sample in the telrick website.
I need to know the editable grid is compatible in r.a.d.controls Q4 2006 ASP.NET 2.x
Thanks in Advance.

Sebastian
Telerik team
 answered on 22 Jun 2009
1 answer
275 views
Hi all,

Please guide us to improve initial load time of RadGrid databinding.

Our scenario is:

1. RadGrid has 7 bound columns and 33 GridTemplateColumns. (Setting column visible property 'false' for 25 GridTemplateColumns at runtime). So total display columns is 15 only.
2. Rendering data size 500KB.
3. It is taking more than 120 seconds to load data in grid.

here is the sample code:

<telerik:RadGrid  ID="RadGrid1" runat="server" Width="960px" AllowPaging="false" PagerStyle-AlwaysVisible="false" 
   HeaderStyle-HorizontalAlign=
"center" BackColor="#e8eefa" HeaderStyle-Font-Size="8" 
  
AllowSorting="false" >  
<ClientSettings Scrolling-UseStaticHeaders="true" >  
    <Scrolling FrozenColumnsCount="2" SaveScrollPosition="false" ScrollHeight ="350px"/>  
</ClientSettings>  
<MasterTableView NoMasterRecordsText="No Matching Record Exists" Name="Master" Width="960px" 
    DataKeyNames="PersonLocationId" EnableColumnsViewState="true" TableLayout="fixed" 
    >  
 <Columns>  
    <telerik:GridTemplateColumn UniqueName="PersonSelected"   
        HeaderStyle-Width="15px" ItemStyle-Width="100%" >  
    </telerik:GridTemplateColumn>  
    <telerik:GridTemplateColumn DataField="PersonName" UniqueName="Person"   
        HeaderStyle-Width="120px" ItemStyle-Width="100%" ItemStyle-HorizontalAlign="left">  
        <ItemTemplate>  
            <asp:Label ID="lblPersonName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PersonName") %>'></asp:Label>  
        </ItemTemplate>  
    </telerik:GridTemplateColumn>  
    <telerik:GridBoundColumn datafield="Specialty" uniquename="Specialty" Visible="false">  
    </telerik:GridBoundColumn>  
    <telerik:GridTemplateColumn uniqueName="Day1" HeaderStyle-Width="35px" ItemStyle-Width="100%" >  
    </telerik:GridTemplateColumn>  
    .....  
    .....  
    <telerik:GridTemplateColumn uniqueName="Day31" HeaderStyle-Width="35px" ItemStyle-Width="100%" >  
    </telerik:GridTemplateColumn>  
 </Columns>  
</MasterTableView>  
</telerik:RadGrid> 
Princy
Top achievements
Rank 2
 answered on 22 Jun 2009
1 answer
175 views
Hello,

i want to use the telerik controls (e.g. scheduler, grid, rotator) with sharepoint designer.
I can drag and drop the controls on a sharepoint site.
But i have two questions:

a) is this a proven way to use the controls? Or have i to use webparts?
b) Is there a way to use the SPDatasource to get data from Sharepoint lists with Sharepoint Designer?

Maybe somebody can show me a short way to accomplish b).

I think spd 2007 is the easiest way to implement telerik controls in our sharepoint sites.

Thank you very much.

Regards

Marc
Sebastian
Telerik team
 answered on 22 Jun 2009
1 answer
128 views
I've got a DataSet with 2 tables that have a relationship between them assigned in the DataSet:

i.e.
DataSet ds = new DataSet();
ds.Tables.Add(customerTable);
ds.Tables.Add(orderTable);
DataColumn parentDC = customerTable.Columns["CustomerID"];
DataColumn childDC = orderTable.Columns["CustomerID"];
ds.Relations.Add("Customer_Orders", parentDC, childDC, false);

My Grid has a MasterTable and DetailTable setup, with the appropriate ParentTableRelation setup.

I was hoping that I could simply set the datasource of the grid to this dataset (the master getting the first datatable, and the detail getting the second), and that the relationship would be used in the DetailTable to filter on expanding, but that does not appear to be the case. Is this possible, and if so, are thre any live examples on the net?

Thanks.
Shinu
Top achievements
Rank 2
 answered on 22 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?