Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
270 views
Hi,
  I am using this code, for nested table (Details tables). my sample code for your reference.

    <telerik:RadGrid ID="rgFeedback" runat="server" Width="100%" ShowStatusBar="True"
        AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" PageSize="5"
        Skin="Vista" GridLines="None" OnDetailTableDataBind="rgFeedback_DetailTableDataBind"
        OnItemCommand="rgFeedback_ItemCommand">
        <MasterTableView DataKeyNames="FeedbackQuestionGroupId">
            <DetailTables>
                <telerik:GridTableView ShowHeader="false" DataKeyNames="FeedBackQuestionId" Name="FeedBackQuestion"
                    Width="100%">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="AAA1" HeaderText="Question">
                            <ItemTemplate>
                                <asp:Label ID="lbl_Question" Width="50%" Text='<%# Eval("FeedbackQuestionName") %>'
                                    runat="server" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="AAA2">
                            <ItemTemplate>
                                <telerik:RadRating ID="rrRatings" runat="server" ItemCount="10" Precision="Half" Orientation="Horizontal" SelectionMode="Continuous"></telerik:RadRating>                               
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>           
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridTemplateColumn HeaderText="Question Group Name">
                    <ItemTemplate>
                        <asp:Label Width="50%" ID="lblQuestionGroupName1" Text='<% # Eval("QuestionGroupName")%>'
                            runat="server"></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Rate">
                    <ItemTemplate>
                        <asp:Label Width="5%" ID="lblQuestionGroupName2" runat="server"></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="SaveQuestionGroup"
                    CommandName="SaveQuestionGroup" ConfirmTitle="CMS asking..." ConfirmText="Save question group details"
                    Text="Save Question Group">
                </telerik:GridButtonColumn>
            </Columns>
            <NoRecordsTemplate>
                <div style="width: 100%; height: 15px; color: Red; text-align: left;">
                    No Records Found.
                </div>
            </NoRecordsTemplate>
        </MasterTableView>
    </telerik:RadGrid>

In ItemCommand event need find the control 'rrRatings' and 'lblQuestionGroupName1' how can i find the value in code behind.
please help me.

Regards,
Tamilselvan.S
Shinu
Top achievements
Rank 2
 answered on 04 Oct 2010
4 answers
85 views
Hi!

We are in the process of upgrading the editor. We develop a software were you can design emails. The formatting of html is very important in various email clients. We have a problem with html designed in the older version of the editor is re-written in the newer version.

Examples
Original
<td width="32" height="35" align="left" valign="top"> </td>
rewritten to
<td style="text-align: left; width: 32px; height: 35px; vertical-align: top;"> </td>

Original
<img src="lasmer.jpg" width="120" height="62" align="right" />

rewritten to
<img alt="" width="120" height="62" style="float: right;" src="lasmer.jpg" />

As you see the height,width and valign attributes are re-written as inline styles.

This does not play well in outlook 2007,2010 which does not support inline style width,height, float + most of the styles.

Is there a workaround?

/Niclas
Niclas Ahlqvist
Top achievements
Rank 1
 answered on 04 Oct 2010
1 answer
110 views
There is some example I found in Silverlight samples.
http://demos.telerik.com/silverlight/#GridView/DataSourceChangeNotifications


I'd like to have the same behavior for AJAX, too. How can it be accomplished with AJAX?
In addition my columns contains 2 RadComboBoxes. The items in second one depends on first. Currenntly I've implemented it this way, using Autopostbacks:
<telerik:RadGrid ID="grdTimesheetsLines" runat="server" AutoGenerateColumns="False" AllowSorting="False" AllowPaging="False" Skin="Vista" PageSize="10" GridLines="Both" EmptyDataText="NO DATA IS AVAILABLE." onneeddatasource="grdTimesheetsLines_NeedDataSource" ShowFooter="true">
    <FooterStyle Font-Bold="true" />
    <AlternatingItemStyle BackColor="AliceBlue"/>
    <ClientSettings>
        <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
    </ClientSettings>
    <MasterTableView DataKeyNames="EmployeeNo, DateWorked, HRPositionCode, LineNo" AllowMultiColumnSorting="false" AllowSorting="False">
        <Columns>
            <telerik:GridDateTimeColumn SortExpression="DateWorked" HeaderText="Date" HeaderButtonType="TextButton" DataField="DateWorked" UniqueName="DateWorked" >
                <ItemStyle HorizontalAlign="Left" Width="100px" />
                <HeaderStyle HorizontalAlign="Left" Width="100px" />
            </telerik:GridDateTimeColumn>
  
            <telerik:GridTemplateColumn SortExpression="HRPositionCode" HeaderText="Position" HeaderButtonType="TextButton" UniqueName="HRPositionCode" DataType="System.String">
                <ItemStyle HorizontalAlign="Left" Width="200px" />
                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                <ItemTemplate>
                    <telerik:RadComboBox ID="grdTimesheetsLines_Positions" runat="server" Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false" OnSelectedIndexChanged="Positions_SelectedIndexChanged" AutoPostBack="true"></telerik:RadComboBox>                     
                </ItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn SortExpression="ActivityCode" HeaderText="Activity" HeaderButtonType="TextButton" UniqueName="ActivityCode" DataType="System.String">
                <ItemStyle HorizontalAlign="Left" Width="200px" />
                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                <ItemTemplate>
                    <telerik:RadComboBox ID="grdTimesheetsLines_Activities" runat="server" Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false"></telerik:RadComboBox>                        
                </ItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn SortExpression="StartTime" HeaderText="Start" HeaderButtonType="TextButton" UniqueName="StartTime" DataType="System.DateTime">
                <ItemStyle HorizontalAlign="Left" Width="120px" />
                <HeaderStyle HorizontalAlign="Left" Width="120px" />
                <ItemTemplate>
                    <telerik:RadTimePicker ID="grdTimesheetsLines_Start" runat="server">
                        <TimeView ID="TimeView1" runat="server" Interval="00:30:00" TabIndex="99">
                        </TimeView>
                    </telerik:RadTimePicker>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn SortExpression="EndTime" HeaderText="End" HeaderButtonType="TextButton" UniqueName="EndTime" DataType="System.DateTime">
                <ItemStyle HorizontalAlign="Left" Width="120px" />
                <HeaderStyle HorizontalAlign="Left" Width="120px" />
                <ItemTemplate>
                    <telerik:RadTimePicker ID="grdTimesheetsLines_End" runat="server">
                        <TimeView ID="TimeView2" runat="server" Interval="00:30:00" TabIndex="99">
                        </TimeView>
                    </telerik:RadTimePicker>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn SortExpression="Quantity" HeaderText="Duration" 
                                            HeaderButtonType="TextButton" UniqueName="Quantity" DataType="System.Decimal">
                <ItemStyle HorizontalAlign="Left" Width="80px" />
                <HeaderStyle HorizontalAlign="Left" Width="80px" />
                <ItemTemplate>
                    <telerik:RadNumericTextBox runat="server" ID="grdTimesheetsLines_Duration" 
                                                                    MinValue="0" Width="50px">
                        <NumberFormat DecimalDigits="2" />
                    </telerik:RadNumericTextBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn SortExpression="Comments" HeaderText="Comments" 
                                            HeaderButtonType="TextButton" UniqueName="Comments" DataType="System.String">
                <ItemStyle HorizontalAlign="Left" />
                <HeaderStyle HorizontalAlign="Left" />
                <ItemTemplate>
                    <telerik:RadTextBox runat="server" ID="grdTimesheetsLines_Comments" 
                                                                MaxLength="250" Width="90%">
                    </telerik:RadTextBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

It works, any refresh in 1st combobox causes delay of few seconds.

Also, when it is loading it takes time, too. Becuase of the Comboboxes have to be filled.

Does anu1 know more elegant solution.
Shinu
Top achievements
Rank 2
 answered on 04 Oct 2010
1 answer
133 views
Below is the structure where we are loading usercontrols in ContentPanel,

 <telerik:RadAjaxPanel ID="ID1" runat="server" LoadingPanelID="LoadingPanel1"
            ClientEvents-OnRequestStart="conditionalPostback">
<telerik:RadSplitter ID="Splitter1" runat="server" Orientation="Horizontal"
    Skin="Windows7" Width="100%" VisibleDuringInit="false" OnClientLoad="OnClientLoad">
    <telerik:RadPane ID="radPaneTab1" runat="server" Height="27px">
        <telerik:RadTabStrip OnClientTabSelecting="onTabSelecting" ID="rtsOrder" SelectedIndex="0"
            runat="server" OnTabClick="rtsOrder_TabClick"
            Skin="Windows7" CausesValidation="false">
        </telerik:RadTabStrip>
    </telerik:RadPane>
    <telerik:RadPane ID="radPaneMultiPage" runat="server" Scrolling="Y">
        <asp:Panel ID="ContentPanel" runat="server" />  
    </telerik:RadPane>        
</telerik:RadSplitter>
</telerik:RadAjaxPanel>

we are loading the user controls by code in the content panel. we have RADgrid in one of the user control and that has all the javascript functions for command,hierarchy and grid created. if i load it directly at first time then it loads fine
but if i load some other tab first and then try to switch to that tab which has grid then it gives error of that it cant find function of RADgrid for gridcreated, command and hierarchy.
need HELP!!! :)
Neo
Top achievements
Rank 1
 answered on 03 Oct 2010
1 answer
112 views
I have a datasource with the fields of FirstName and LastName.  I want the griddropdowncolumn to display the concatenated firstname and lastnam fields together, but the ListTextField only wants one column.  Is there a quick solution for this?  Thanks.

 

Kathy
Top achievements
Rank 1
 answered on 03 Oct 2010
4 answers
671 views
I am testing a RadGrid that uses multiple GridTemplateColumns because I need a multi-line header so inside of each GridTemplateColumn I have HeaderTemplate and an ItemTemplate to define cells with a table for display. This works as required. In my test case I have 6 gridtemplatecolumns that make up one RadGrid. Now I want to test how to make one of these six gridtemplatecolumns Not Visible at PreRender. I have tried this in the declarative (as part of the GridTemplateColumn I set this to Visible=False) and the column is not displayed, just as I want. However, I cannot figure out how to accomplish the same in code behind.

Let's say I have:
    GridTemplateColumn UniqueName="GTC1"
         HeaderTemplate
         ItemTemplate
    GridTemplateColumn UniqueName="GTC2"
         HeaderTemplate
         ItemTemplate
    GridTemplateColumn UniqueName="GTC3"
         HeaderTemplate
         ItemTemplate

Now I want to make "GTC2" Not Visible in code behind. How do I perform a findcontrol on "GTC2" in PreRender event? If I can find "GTC2" then I can set Visible=False. I think I want to perform this findcontrol in PreRender or do I need to access the GridTemplateColumn in a different event to make this work?

I tried this in PreRender:

 

Dim gtc As GridTemplateColumn = TryCast(RadGrid1.FindControl("GTC2"), GridTemplateColumn)

 

gtc.Visible =

 

False

 

 


This gives the message "Type System.Web.Ui.Control cannot be converted to Telerik.Web.Ui.GridTemplateColumn." Maybe I cannot access the GridTemplateColumn in code behind? If not, how might I access the tables that are defined inside of the HeaderTemplate and ItemTemplate?

Thanks in advance for any help you can provide...Dan

DanR
Top achievements
Rank 1
 answered on 03 Oct 2010
2 answers
109 views
Hi,

I use this code :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure"  SelectCommand="Net_DepechesTest"  />
  
<telerik:RadListView ID="Liste" DataSourceID="SqlDataSource1"  runat="server"  ClientIDMode="Static"
                onitemdatabound="Liste_ItemDataBound" AllowPaging="True" ItemPlaceholderID="ArticlesHolder"  DataKeyNames="IDDepeche" PageSize="15">
                <LayoutTemplate>
                    <telerik:RadDataPager ClientIDMode="Static" ID="PagerUp" SEOPagingQueryPageKey="pager"  AllowSEOPaging="true" runat="server" PagedControlID="Liste" PageSize="15" Visible='<%# Container.PageCount != 1%>'>
                        <Fields>                                
                            <telerik:RadDataPagerButtonField FieldType="NextLast" />
                            <telerik:RadDataPagerButtonField FieldType="Numeric" />
                            <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                            <telerik:RadDataPagerTemplatePageField><PagerTemplate>Page(s) : </PagerTemplate></telerik:RadDataPagerTemplatePageField>
                        </Fields>
                     </telerik:RadDataPager>
                     <div id="ListDepeches">
                        <asp:Panel ID="ArticlesHolder" ClientIDMode="Static" runat="server" />
                     </div>
                     <telerik:RadDataPager ClientIDMode="Static" ID="PagerDown" SEOPagingQueryPageKey="pager" AllowSEOPaging="true" runat="server" PagedControlID="Liste" PageSize="15" Visible='<%# Container.PageCount != 1%>'>
                        <Fields>                                
                            <telerik:RadDataPagerButtonField FieldType="NextLast" />
                            <telerik:RadDataPagerButtonField FieldType="Numeric" />
                            <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                            <telerik:RadDataPagerTemplatePageField><PagerTemplate>Page(s) : </PagerTemplate></telerik:RadDataPagerTemplatePageField>
                        </Fields>
                     </telerik:RadDataPager>
                </LayoutTemplate>
                <ItemTemplate>
                        <asp:Literal ID="LesArticles" runat="server"></asp:Literal>
                </ItemTemplate>
                <EmptyDataTemplate>Aucune actualité disponible</EmptyDataTemplate>
            </telerik:RadListView>

When i call this page, i have 28 records and so 2 pages of results.
If i click on the second page (paging number or next button), my url change to "mypage.aspx?pager=2" and all is allright !!.

Now i decide to modify directly my url to "mypage.aspx?pager=3" (3 is for example, but is the same with a number superior to the Max Pages showing "2"). And that is my problem !!, the page call a StackOverFlow Error on my WeDevServer and in Production on a IIS 7.5 !. My Application Pool Stop and never restart !

Can someone help me, if you understand my english :o)
Mikolaj
Top achievements
Rank 1
 answered on 02 Oct 2010
0 answers
68 views
forget it fixed it :) I was being dumb
Stephen Naughton
Top achievements
Rank 1
 asked on 02 Oct 2010
3 answers
205 views
I have a couple of problems that I cannot figure out.

1. When editing an appointment, the advance form is displayed. If I make changes to the form and click 'Save', I handle the updates to SQL with the following. This updates my database, but the window does not close. How do I get the modal window to close?

 

Private Sub UpdateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles UpdateButton.Click

 

 

Dim AppointmentBE as New AppointmentBE

 

 

Dim ProspectToolDAL As New ProspectToolDAL

 

 

Dim startDateString as String

 

 

Dim startTimeString as String

 

 

Dim endDateString as String

 

 

Dim endTimeString as String

 

AppointmentBE.Subject = SubjectText.Text

AppointmentBE.AppointmentKey = Appointment.ID

startDateString =

"#" & Format(StartDate.SelectedDate, "MM/dd/yyyy")

 

startTimeString = StartTime.SelectedDate.Value.ToShortTimeString &

"#"

 

AppointmentBE.StartTime =

CDate(startDateString & " " & startTimeString)

 

endDateString =

"#" & Format(EndDate.SelectedDate, "MM/dd/yyyy")

 

endTimeString = EndTime.SelectedDate.Value.ToShortTimeString &

"#"

 

AppointmentBE.EndTime =

CDate(endDateString & " " & endTimeString)

 

 

 

Dim appointmentKey as Int32 = ProspectToolDAL.SaveAppointment(AppointmentBE, "U")

 

 

End Sub

2. The second problem is once the window is closed (by clicking 'Cancel'), the appointment does not show it's new values. How can I get the scheduler to 'refresh' once the modal window is closed?

Thanks,
Susan

 

Susan
Top achievements
Rank 1
 answered on 02 Oct 2010
2 answers
107 views
Hi,

I am using radgrid for showing database data, and in footer section, i am showing average of  one column data.
Now beside that i need to show that average to the some where inside pager template region.

But i dont know how can i show that thing inside pager region.

naimish
Top achievements
Rank 1
 answered on 02 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?