Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
111 views
I am using the following: VS2008, Windows XP, IE7, the latest Telerik product and C#.

I have used the Configuration Tool to set my data instead of writing backend code to do so.  
My Datasource is as follows:

 

<asp:EntityDataSource ID="EntityDataSource1" runat="server"

 

ConnectionString="name=AllDataModels" DefaultContainerName="AllDataModels"

 

 

 

EntitySetName="Project" Select="it.[Name], it.[Identifier], it.[ID]">

 

 

 

</asp:EntityDataSource>

 

 

 

 

 


I have then selected from the RadGrid Tasks from the arrow in design view -->  General Features and checked "Enable Paging".

I am getting a error on the page when paging is enabled, but when paging is not enabled... the data is generated just fine and I can see all.  When I enable paging ... I get the error again.

Here is my aspx code:

<

 

telerik:RadGrid ID="RadGrid1" runat="server"

 

style="z-index: 1; left: 9px; top: 122px; position: absolute;"

 

 

 

AllowSorting="True" DataSourceID="EntityDataSource1" GridLines="None"

 

 

 

AllowPaging="True">

 

 

 <

MasterTableView AutoGenerateColumns="False" DataSourceID="EntityDataSource1">

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="Name" HeaderText="Name" ReadOnly="True"

 

 

 

SortExpression="Name" UniqueName="Name">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Identifier" HeaderText="Identifier"

 

 

 

ReadOnly="True" SortExpression="Identifier" UniqueName="Identifier">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"

 

 

 

ReadOnly="True" SortExpression="ID" UniqueName="ID">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

Thanks for any help you can give.  :)

~wen

Daniel
Telerik team
 answered on 28 Dec 2009
3 answers
142 views
Dear All

i have a radgrid, with item templates . i need to get the control in item template using javascript.

Thanks in Advance.

Regards
Balagangadharan.R
Dimo
Telerik team
 answered on 28 Dec 2009
5 answers
207 views
I've got some problems with Telerik livedemo site.
  • "Telerik' is undefined
  • Object not reference
  • Sys is undefine
i tried to reinstall telerik, .net version 2.0, 3.5... but i can not fix this problem that make me can not access any radcontrol ...
I've read many suggestion in this forum but  all of them are show the way to fix individual project. I can't understand why the live demo site in telerik get this problems.
Any Suggestion?
Many thanks.
T. Tsonev
Telerik team
 answered on 28 Dec 2009
2 answers
233 views
Argh...I apologize for bugging everyone at this time of the year, but I am having issues trying to retrieve the selected values from a combo box inside client javascript and am working on a demanding schedule.

I have a combo box (for example) populated as:

Item 1: Text=Sell; Value=1.
Item 2: Text=Rent; Value=2.
Item 3: Text=Trade; Value=3.

When the user selects an item from the combo (and enters text in a couple of textboxes) then clicks on an item on the screen, I need to open a new window and pass the value selected in the combo box.  I can't do this inside the server code, because a postback would end up basically performing a redirect and I need to keep the original window on the screen.

I cannot capture the combo box selected value when the user selects it, because they may just use the default value thus not triggering any events on the combo box before clicking on the screen item to continue.

I should add that I am using the combo box on a page that utilizes a master page, and that the combo box is defined inside a RadDock.

In my client javascript, I have tried several methods of doing this, but all I can seem to retrieve is the text value displayed in the combo box.  For examples:

Example 1.  The following code retrieves the actual visible text value from the combo (i.e. - trade, sell, rent)

a1 = document.getElementById("<%= ListTranType.ClientID %>").value;
alert(a1);

Example 2.  In the following, b1 displays [object object] and b2 displays undefined

var b1 = $find("<%= ListTranType.ClientID %>");
alert(b1);
var b2 = b1.value;
alert(b2);

Example 3.  The following code works exactly like #1 above. Only the visible text from the combo is displayed (sell, rent, trade).

var b1 = $find("<%= ListTranType.ClientID %>").value;
alert(b1);


The combo box is defined as shown below. 

<

 

telerik:RadComboBox ID="ListTranType" OnClientSelectedIndexChanged="gettrantype" EnableEmbeddedSkins="true" Skin="Black" runat="server" Width="200px" ></telerik:RadComboBox>

 

 I do have a script for capturing the value when the user selects one and it works fine as it is, but as said earlier sometimes the user will use the default value or not select one from the combo before clicking to proceed.  Both of these actions are valid within the application.  The code used to capture the value during the event is:

 

<script type="text/javascript">

 

 

 

var trantype;

 

 

function gettrantype(combo, eventArqs) {

 

 

var item = eventArqs.get_item();

 

trantypeval = item.get_value();

}


SUMMARY QUESTION:  What I need to retrieve from the combo box is the data loaded as the "value".  In the examples above, this would be either the 1, 2, or 3 -- not sell, rent, or trade.  How do I get the true selected value from the combo?

Thanks very much in advance!

Lynn




Lynn
Top achievements
Rank 2
 answered on 28 Dec 2009
1 answer
214 views
Hi everybody,

I try to add Columns to a RadGrid dynamically and I'm able to do it, but, when i do a post back
the RadGrid's columns are reinitialized and i don't want it. i want that my RadGrid stay
as it was before postback. Why? i want to save the columns' position and if the RadGrid
is reinitialized, I can't it.

Example:

RadGrid Status (initial):

Column1 Column2 Column3

User changes the columns' order:

Column3 Column2 Column1

User does post back and RadGrid come back to status initial.

Column1 Column2 Column3

If i do that in a page aspx (which not inherits of a masterpage), my code works, but
with a masterPage doesnt work. someone has an idea?

It's a very simple thing but i tried to do it and I'm not be able, i read all forums and i do all, but that not works in a page which inherits of a master page.

Someone can help me?

My RadGrid's code:
                                <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="false"  
                                    EnableLinqExpressions="false" GridLines="None"  AutoGenerateColumns="false"  
                                        Skin="InductDefault" EnableEmbeddedSkins="false"  
                                        onneeddatasource="RadGrid2_NeedDataSource"> 
                                    <MasterTableView AutoGenerateColumns="False" EnableNoRecordsTemplate="false"  
                                        HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" Width="100%"> 
                                    </MasterTableView> 
                                    <ClientSettings AllowColumnHide="true" AllowColumnsReorder="true"  
                                        ReorderColumnsOnClient="true"> 
                                    </ClientSettings> 
                                </telerik:RadGrid> 

C# code:

    protected void page_Init(object sender, EventArgs e) 
    { 
        if (!IsPostBack) 
        { 
            createRadGrid2(); 
        } 
    } 
 
    public void createRadGrid2() 
    { 
        XDocument xmlDoc = XDocument.Load(RadGridXmlConfig); 
        var Columns = xmlDoc.Elements("Columns") 
                              .Elements("Column") 
                              .Attributes("uniqueName"); 
 
        foreach (var colTemp in Columns) 
        { 
            String uniqueName = colTemp.Value; 
            tableTripsDetail.Columns.Add(uniqueName); 
            RadGrid2.MasterTableView.Columns.Add(createBoundColumn(uniqueName)); 
        } 
    } 
 
    protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        RadGrid2.DataSource = getTableReportTripsDetail(); 
    } 
 
    private GridBoundColumn createBoundColumn(String valueUnique) 
    { 
        GridBoundColumn BoundColumn = new GridBoundColumn(); 
        BoundColumn.DataField = valueUnique; 
        BoundColumn.HeaderText = valueUnique; 
        BoundColumn.SortExpression = valueUnique; 
        BoundColumn.UniqueName = valueUnique; 
 
        return BoundColumn; 
    } 

Veli
Telerik team
 answered on 28 Dec 2009
0 answers
178 views
Hi there,
1) Iam using a Radgrid which consists of '4' image columns on page load it is getting loaded fine but when I perform any Filter option which is provided with grid it is taking time for getting loaded for image columns remaining columns load quickly  same with page index also is not getting loaded.Iam using a timer for page it is set for 3 minutes after that only the page is getting loaded after that only the image columns or showing I want to get to be loaded when i perform any operation.

2) And Iam facing another problem with grouping it is grouping properly when i drag some times it is grouped but some times not in this also image columns are not getting loaded when iam ungrouping it is throwing an exception.

3) I want Tooltip for Radgrid for all columns It should display according to database.

Here's my code
------------------------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uclTaskGrid.ascx.cs" Inherits="uclTaskGrid"  %>
  <%@ Register assembly="msgBox" namespace="BunnyBear" tagprefix="cc2" %>
  <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  <script language="javascript" type="text/javascript"> 
  function FireMyIASGroupPrint(myURL){
   if(myURL)
     {
    
    window.open("RejectTaskStatus.aspx?taskID=" + myURL ,'_blank','left = 300, top=150, width=600, height=200,menubar=no , scrollbars=no, resizable=no');
    
     }
}



     
    </script>
<asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="12000">
</asp:Timer>
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
        <td valign="top" height="6"></td>
        </tr>
<tr>
        <td height="30" align="left">&nbsp;&nbsp;&nbsp;<b>Project name</b>&nbsp;<asp:DropDownList ID="ddlProjects" CssClass="text" runat="server" AutoPostBack="True" 
        onselectedindexchanged="ddlProjects_SelectedIndexChanged">
    </asp:DropDownList>
            
        </td>
    <td align="right">
    <table width="160" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:Label ID="lblRecCount" CssClass="LabelText" runat="server" 
    Text="Total Record(s): 14"></asp:Label>
                    </ContentTemplate>
                </asp:UpdatePanel>
            &nbsp;&nbsp;&nbsp;</td>
          </tr>
</table>
</td>
</tr>
  <tr>
        <td valign="top" colspan="2" height="5">
            &nbsp;</td></tr>  
<tr>
        <td valign="top" align="center" colspan="2">
    <table cellpadding="0" cellspacing="0" border="0" width="98%">
    <tr>
    <td align="left" valign="top">    
           
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                     <Triggers>  
                        <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />  
                    </Triggers> 
                        <ContentTemplate>
                            <telerik:RadGrid ID="gviewTasks" runat="server" AllowFilteringByColumn="True" 
        AllowPaging="True" AllowScroll="True" EnableVirtualScrollPaging="True" 
                                PageSize="10" AllowSorting="True" GridLines="None" ShowGroupPanel="True" 
            style="top: 300px; left: 10px;" 
        AutoGenerateColumns="False" Skin="Vista" onitemcommand="gviewTasks_ItemCommand" 
                                onitemdatabound="gviewTasks_ItemDataBound" AutoGenerateHierarchy="True" AllowCustomPaging="True" 
                                
         >
        
<MasterTableView>


<columns>
          <telerik:GridBoundColumn DataField="TaskID" HeaderText="ID" />           
                      
<telerik:GridBoundColumn DataField="Resource Name" HeaderText="Resource Name" 
              HeaderStyle-Width="80px"  >
    <HeaderStyle Width="80px" />
          </telerik:GridBoundColumn>
 <telerik:GridTemplateColumn HeaderText="Task Name" AllowFiltering="false" Groupable="false" HeaderStyle-Width="50px" >
                       <ItemTemplate>
                       <asp:LinkButton ID="lnkTask" runat="server" CommandName="select"></asp:LinkButton>
                       </ItemTemplate>
                       <HeaderStyle Width="50px" />
                       </telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Task Name" HeaderText="TaskName"  />
<telerik:GridBoundColumn DataField="Description" HeaderText="TaskDescription" 
              HeaderStyle-Width="80px"  >
    <HeaderStyle Width="80px" />
          </telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Phase" HeaderStyle-Width="50px" AllowFiltering="false" Groupable="false"  > 
            <ItemTemplate>
                <asp:Label ID="lblphase" runat="server"  Text='<%#DataBinder.Eval(Container.DataItem,"Phase") %>'></asp:Label> &nbsp;
               </ItemTemplate>
               <HeaderStyle Width="50px" />
               </telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Project Name" HeaderText="Project" 
              HeaderStyle-Width="50px" AllowFiltering="false" >
    <HeaderStyle Width="50px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AssignedBy" HeaderText="Assigned By" 
              HeaderStyle-Width="75px"  >
    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Estimated Hours" HeaderText="ETA [Hrs]" 
              HeaderStyle-Width="50px"  >
    <HeaderStyle Width="50px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Date" HeaderText="Date" HeaderStyle-Width="75px"  >
    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Status" HeaderText="Status" HeaderStyle-Width="75px" >
    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Approve Status" HeaderText="Approval Status" 
              HeaderStyle-Width="75px"  >

    <HeaderStyle Width="75px" />
          </telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Approve" AllowFiltering="false" Groupable="false" HeaderStyle-Width="40px" >
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgbtnactivate" runat="server" ImageUrl="~/images/activate.gif" CommandName="Approve" OnClientClick="return confirm('Are you sure you want to approve this task?');"></asp:ImageButton>
                       
                       </ItemTemplate>
                       <HeaderStyle Width="40px" />
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="Reject" AllowFiltering="false" Groupable="false" HeaderStyle-Width="30px" >
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgbtndeactivate" runat="server" ImageUrl="~/images/de-activate.gif" CommandName="Reject" OnClientClick="return confirm('Are you sure you want to reject this task?');"></asp:ImageButton>
                       
                       </ItemTemplate>
                            <HeaderStyle Width="30px" />
                            </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText="Forward" AllowFiltering="false" Groupable="false" HeaderStyle-Width="40px">
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgforward" runat="server" ImageUrl="~/images/forward.gif" CommandName="Select1"></asp:ImageButton>
                       
                       </ItemTemplate>
                           <HeaderStyle Width="40px" />
                       </telerik:GridTemplateColumn>  
                        <telerik:GridBoundColumn DataField="ResourceID"/>                                  
                       <telerik:GridTemplateColumn HeaderText="Delete" AllowFiltering="false" Groupable="false" HeaderStyle-Width="30px">
                       <ItemTemplate>
                                            
                       <asp:ImageButton ID="imgdelete" runat="server"    ImageUrl="~/images/delete-icon.gif" CommandName="deleteTask" OnClientClick="return confirm('Are you sure you want to delete the task?');"></asp:ImageButton>
                       
                       </ItemTemplate>
                           <HeaderStyle Width="30px" />
                       </telerik:GridTemplateColumn>
                      
                       
</columns>

</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true" />
                <Scrolling EnableVirtualScrollPaging="True" UseStaticHeaders="True" />
                <Resizing AllowColumnResize="True" />
            </ClientSettings>
        <ClientSettings AllowDragToGroup="True" AllowExpandCollapse="true">
            <Scrolling EnableVirtualScrollPaging="True" UseStaticHeaders="True" />
            <Resizing AllowColumnResize="True" />
        </ClientSettings>
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="Blue" />
                                <PagerStyle Height="30px" HorizontalAlign="Center" Font-Bold="True" 
                                    Font-Names="Arial" Font-Size="Smaller" />
                                <HeaderStyle BorderStyle="None"  Font-Bold="True" 
        Height="30px" />
                            </telerik:RadGrid>
                              
                        </ContentTemplate>
                    </asp:UpdatePanel></td></tr>
                    </table>
              
</td>
</tr></table>
-------------------------------------------------------------------------------------
here's the code for tooltip
-------------------------------------
 protected void gviewTasks_ItemDataBound(object sender, GridItemEventArgs e)
    {
        int index;
        try
        {
            if (e.Item.ItemType == GridItemType.CommandItem )
            {

                index = e.Item.RowIndex + (gviewTasks.PageSize * gviewTasks.PageSize);
                for (int i = 0; i < e.Item.Cells.Count; i++)
                {
                    if (dtTemp.Rows.Count > 0)
                    {
                        e.Item.Cells[0].ToolTip = dtTemp.Rows[index]["Resource Name_Org"].ToString();
                        e.Item.Cells[2].ToolTip = dtTemp.Rows[index]["Task Name_Org"].ToString();
                        e.Item.Cells[3].ToolTip = dtTemp.Rows[index]["Task Name_Org"].ToString();
                        e.Item.Cells[4].ToolTip = dtTemp.Rows[index]["Description_Org"].ToString();
                        e.Item.Cells[5].ToolTip = dtTemp.Rows[index]["Phase_Org"].ToString();
                        e.Item.Cells[6].ToolTip = dtTemp.Rows[index]["Project Name_Org"].ToString();
                        e.Item.Cells[7].ToolTip = dtTemp.Rows[index]["AssignedBy_org"].ToString();
                        e.Item.Cells[8].ToolTip = dtTemp.Rows[index]["Estimated Hours_org"].ToString();
                        e.Item.Cells[9].ToolTip = dtTemp.Rows[index]["Date_Org"].ToString();
                        e.Item.Cells[10].ToolTip = dtTemp.Rows[index]["Status_Org"].ToString();
                        e.Item.Cells[11].ToolTip = dtTemp.Rows[index]["Approve Status_Org"].ToString();
                    }
                }
            }

        }
        catch (Exception ex)
        {
        }

    }

----------------------------------------------------------------------------------------------------
ratan mishra
Top achievements
Rank 1
 asked on 28 Dec 2009
1 answer
137 views
Hello community,

I was trying to create a series of Treeview controls and arrange them to create an NCAA Bracket.  Of course, ideally, I would like to minimize the number of controls on a webpage, but I didn't get too far.  My thought was have a treeview on the left (if looking at the image attached, say UNC vs Mt. St. Mary's) and using client-side code - move the selected team over to another treeview control off to the right (round 2) - in the appropriate node.  So, the UNC/MSM winner would go as the top node in round two, the Indiana/Arkansas winner would go to node two.  I was able to get the text of the selected node in round one using javascript, but was unable to add it to another treeview (for round two).  In the end, all the selections would be saved to SQL Server.

Has anyone ever tried this?

Thanks in advance!

Kevin
Kamen Bundev
Telerik team
 answered on 28 Dec 2009
3 answers
162 views
Hello,

I'm using the EmptyMessageStyle-BorderColor and I'm using the EmptyMessageStyle-BackColor properties of the RadInput control and would like to apply the same style and functionality to a RadComboBox.  How would I go about adding the border and backcolor styles when a user has not selected an item in the combobox?  Thanks!!
Yana
Telerik team
 answered on 28 Dec 2009
11 answers
247 views
Hi Telerik,
I upgraded to SP2 and now my Application makes the following JavaScript error after clicking a RadToolBar Button:
Here is the debugged Code:
...var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,...(in the Debugging, h is undefined)
I know, it's cryptic, but I don't know where to begin searching...

Regards,
Andreas

Veselin Vasilev
Telerik team
 answered on 28 Dec 2009
4 answers
301 views
Hi,
I'm using a RadDateInput control. The Culture is set to English(United States) and Dateformat, DisplayDate format are set to MM/yyyy.
When I run the application if I enter a value like 03/2010 on leaving the control the value is set to 05/2010 (the month part is being replaced by the current month). How can I fix this problem?

I don't need a date value; I just want the month and year from the user which will be stored in database in MM/yyyy fomat (varchar).
Appreciate any one has a solution for this. (I've even tried with RadDatePicker; the behavior is same as the RadDateInput)

Thanks.

Regards,
Prashanth

Princy
Top achievements
Rank 2
 answered on 28 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?