Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
159 views
Hi,

I have a tree view bound from the database, so that by clicking on a node I can found the text and corresponding data value field.

protected void GenerateCompanyTree()
{
DataTable DtCompany;
JOMCMiddleWare.BL.CompanyStructure oCompanyStructure = new JOMCMiddleWare.BL.CompanyStructure();

oCompanyStructure._Module_Id = oCompanyStructure._Module_Id;
oCompanyStructure._Language_Id = Convert.ToInt32(Session[JOMCSession.__Session_Lanuage_Id]);
oCompanyStructure._Company_Id = Convert.ToInt32(Session[JOMCSession.__Session_Company_Id]);
DtCompany = oCompanyStructure.GetDataAllTreeViewCompanyStructure();

if (DtCompany.Rows.Count > 0)
{
RadTreeViewCompany.DataSource = DtCompany;
RadTreeViewCompany.DataTextField = "Module_Content_Text";
RadTreeViewCompany.DataFieldID = "Company_Id";
RadTreeViewCompany.DataFieldParentID = "Company_Parent_Id";
RadTreeViewCompany.DataValueField = "Company_Id";
RadTreeViewCompany.DataBind();
RadTreeViewCompany.ExpandAllNodes();
}
}

Now, I have the requirement that I have to enable only those nodes at the bottom (leaf level) only.
Any idea, how to achieve this?

Thanks
Veronica
Telerik team
 answered on 04 Oct 2010
1 answer
308 views
Hi,

I'm a lamer for sure :-) but:
there is a following declaration on my .aspx page:
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true">
    <Scripts>
....
      <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
      </asp:ScriptReference>
....
    </Scripts>
  </telerik:RadScriptManager>

But when I try to do something with jQuery, the jQuery object is undefined. What should I do to be able to use it?

Regards
Tomasz
Tsvetie
Telerik team
 answered on 04 Oct 2010
1 answer
110 views
I have a RadListBox in a radgrid with the editformtype template and I want to validate that the RadListBox have at least one item. Is there a way to validate that with a FieldValidator.
Princy
Top achievements
Rank 2
 answered on 04 Oct 2010
1 answer
363 views
Hello,

I have a problem in displying the radwindow control in the following manner:
I need to display the radwindow in 100% height and auto width. in other words, By clicking an image, the radwindow control must be displayed in maximum height (With no scrolling) and the radwindow control width must be as the width of its content (Please display the attached image)

Here is my code:

telerik

 

 

:RadWindowManager ID="RadWindowManager1" runat="server">

 

 

 

<Windows>

 

 

 

<telerik:RadWindow

 

 

 

id="RadWindow1"

 

 

 

runat="server"

 

 

 

showcontentduringload="false"

 

 

 

Height="100%"

 

 

 

VisibleTitlebar="false"

 

 

 

VisibleStatusbar="false"

 

 

 

title="Telerik RadWindow"

 

 

 

behaviors="Default">

 

 

 

</telerik:RadWindow>

 

 

 

</Windows>

 

 

 

</telerik:RadWindowManager>

 

 

 

<asp:Button ID="Button1" runat="server" Text="Button"

 

 

 

onclick="Button1_Click" />

 


protected

 

 

void Button1_Click(object sender, EventArgs e)

 

{

RadWindow1.VisibleOnPageLoad =

 

true;

 

}

Please, What I should do in order to achieve the requirements,
It is appreciated to send me the modified code.

Regards,
Bader


Georgi Tunev
Telerik team
 answered on 04 Oct 2010
1 answer
248 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
72 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
87 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
103 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
103 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
627 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?