Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
240 views
Hi,

I have used one of the columns as griddropdowncolumn. Datafield="resource_id" and  ListTextField="Resource_Name"  and ListValueField="Resource_ID" which i am getting this from another sqldatasource2.

What i need is, i want to display Resource_Name in GridGroupByExpression. I am getting resource_id which i don't want. I want only Resource Name.


<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None" 
        ShowGroupPanel="True" Skin="Sunset"> 
        <MasterTableView AutoGenerateColumns="False" CellSpacing="-1" DataSourceID="SqlDataSource1"> 
         
        <GroupByExpressions> 
                    <telerik:GridGroupByExpression> 
                        <SelectFields> 
                            <telerik:GridGroupByField FieldAlias="Resource-ID" FieldName="Resource_Name"  
                                HeaderValueSeparator=" : " FormatString="" HeaderText=""></telerik:GridGroupByField> 
                        </SelectFields> 
                        <GroupByFields> 
                            <telerik:GridGroupByField FieldName="Resource_Name" SortOrder="Descending" FieldAlias="Resource_Name" FormatString="" HeaderText=""></telerik:GridGroupByField> 
                        </GroupByFields> 
                    </telerik:GridGroupByExpression> 
                </GroupByExpressions> 
         
         
         
         
            <Columns> 
                <telerik:GridBoundColumn DataField="Assignment" HeaderText="Assignment" SortExpression="Assignment" 
                    UniqueName="Assignment"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Task" HeaderText="Task" SortExpression="Task" 
                    UniqueName="Task"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M9_Sep" DataType="System.Int16" HeaderText="Sep" 
                    SortExpression="M9_Sep" UniqueName="M9_Sep"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M10_Oct" DataType="System.Int16" HeaderText="Oct" 
                    SortExpression="M10_Oct" UniqueName="M10_Oct"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M11_Nov" DataType="System.Int16" HeaderText="Nov" 
                    SortExpression="M11_Nov" UniqueName="M11_Nov"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M12_Dec" DataType="System.Int16" HeaderText="Dec" 
                    SortExpression="M12_Dec" UniqueName="M12_Dec"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M1_Jan" DataType="System.Int16" HeaderText="Jan" 
                    SortExpression="M1_Jan" UniqueName="M1_Jan"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M2_Feb" DataType="System.Int16" HeaderText="Feb" 
                    SortExpression="M2_Feb" UniqueName="M2_Feb"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M3_Mar" DataType="System.Int16" HeaderText="Mar" 
                    SortExpression="M3_Mar" UniqueName="M3_Mar"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M4_Apr" DataType="System.Int16" HeaderText="Apr" 
                    SortExpression="M4_Apr" UniqueName="M4_Apr"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="M5_May" DataType="System.Int16" HeaderText="May" 
                    SortExpression="M5_May" UniqueName="M5_May"> 
                </telerik:GridBoundColumn> 
                 
                    
                    <telerik:GridDropDownColumn DataField="Resource_Name" DataSourceID="SqlDataSource2" 
                        HeaderText="Resource" ListTextField="Resource_Name" ListValueField="Resource_id" DataType="System.Int32" 
                        UniqueName="UniqueTaskName"> 
                        </telerik:GridDropDownColumn>  
                 
                 
                <telerik:GridBoundColumn DataField="Resource_Name" DataType="System.Int64" HeaderText="Resource-Name" 
                    SortExpression="Resource_Name" UniqueName="Resource_Name" GroupByExpression="Resource_Name" Display="False"> 
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="True"> 
        </ClientSettings> 
    </telerik:RadGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>" 
        SelectCommand="SELECT [Assignment], [Task], [M9_Sep], [M10_Oct], [M11_Nov], [M12_Dec], [M1_Jan], [M2_Feb], [M3_Mar], [M4_Apr], [M5_May], [Resource_Name] FROM [Resource_Data] WHERE (([Resource_Year] = @Resource_Year) AND ([Resource_Month] = @Resource_Month) AND ([Resource_week] = @Resource_week))"> 
        <SelectParameters> 
            <asp:QueryStringParameter Name="Resource_Year" QueryStringField="RYear" Type="Int16" /> 
            <asp:QueryStringParameter Name="Resource_Month" QueryStringField="RMonth" Type="Int16" /> 
            <asp:QueryStringParameter Name="Resource_week" QueryStringField="RWeek" Type="Int16" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ResourceUtilizationDBConnectionString %>" 
        SelectCommand="SELECT [Resource_Name], [Resource_ID] FROM [Resource_Information]"> 
    </asp:SqlDataSource> 

Stroika
Top achievements
Rank 1
 answered on 11 Mar 2010
2 answers
94 views
from the demo, i saw we can set ColumnWidth for the schedular.
Can i set height of column?
Iry Lee
Top achievements
Rank 2
 answered on 11 Mar 2010
1 answer
74 views
hi everybody I want change header in radgridview .you see mock-up:
can you help me?
Shinu
Top achievements
Rank 2
 answered on 11 Mar 2010
2 answers
620 views
Hi,

I am trying to get a control ID of a telerik RadTextBox, using following syntax

var pwd1 = document.getElementById("<%= passwordTextBox.ClientID %>");
and I also tried
var pwd1 = $find("<%= passwordTextBox.ClientID %>");

The script is used inside a user control,

This gives following error,

The Controls collection cannot be modified because the control contains code blocks




And when I use,
var pwd1 = $find("<%# passwordTextBox.ClientID %>");

when look at the source, it is just empty string in place (var pwd1 = $find("");)

I tried both ClientID and UniqueID , but it does not works either,

(This code is used inside a UserControl and page uses themes hence it's not possible to remove runat="server" tag in the header section)



Adipa Gunasekara
Top achievements
Rank 1
 answered on 11 Mar 2010
1 answer
161 views
Hi,
I am not good at css but I have to transfer my old navigation bar to tab control. I have read this article
http://www.telerik.com/help/aspnet/tabstrip/tabsrip_cssstylesfornormalstate.html

but I dun really know how to implement it if I have configured all the li, ul, a hover b4..Would u mind to upload the example code of the above article?
louis chan
Top achievements
Rank 1
Iron
 answered on 11 Mar 2010
3 answers
227 views
Hi

I want to customise menus, but rather than having to recreate all of the css, it seems to me that it would make sense to just add whatever css is required to alter the base css.

But if I have EnableEmbeddedBaseStyleSheet = "True", the base css gets loaded after mine, overriding it, which isn't very useful, but if I set it to false, there is no css at all except what I provide.

Can you tell me is it possible to arrange for the base css to be loaded first?

Thanks

Rob
Rob
Top achievements
Rank 1
 answered on 11 Mar 2010
4 answers
213 views
Hi,

In my project, when I upload file using SoftArtisan FileUp component, for the Transfer Progress Window, I am using a RadWindow and update the content of that RadWindow using
 transferwindow.get_contentFrame().contentWindow.document.write(strHTML);
strHTMl is the string to be written to RadWindow including the
<HTML><HEAD><TITLE>" + "Transfer Status" + "</TITLE> and other content needed for  HTML page.

I have a requirement where I have to open another page parallel to this transfer window. Can I open my tranfer window in RadPane inside the RadSplitter , where I can open my second page in the second RadPane. Can I update the content of the RadPane dynamically passing the string to the page?

Thanks.

kachy
Top achievements
Rank 1
 answered on 10 Mar 2010
2 answers
358 views
Hello,

I am using Version=2009.3.1208.35 and programming in asp.net vb.

I have a RadGrid bound to a SQL Data Source.

I would like to be able to hide the cell content of a GridHyperLinkColumn if the value in a field is not empty or not null.

Here is my ASPX code.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="employee.aspx.vb" Inherits="cf_console_admin_profiles_employee_employee" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<%@ Register assembly="Telerik.Web.UI, Version=2009.3.1208.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Fleet Compliance Management System</title> 
    <link rel="stylesheet" type="text/css" href="http://cf.visionquestit.net/includes/styles/cf_style.css"/>  
</head> 
<body> 
<form id="form1" runat="server">  
     
          
<table id="tablePageBodyContainer" class="tablePageBodyContainer">  
    <tr> 
        <td> 
        <table id="tablePageHeader" class="tablePageHeader">  
            <tr> 
                <td class="tablePageHeaderColumn">  
                    <div class="divPageHeader">  
                        <span class="spanLoginTitle">  
                        Logged In  
                        </span><br/>  
                        <span class="spanLoginUserName">  
                        <%Response.Write(Session("x_Firstname"))%> 
                        </span> 
                        <span class="spanLoginUserName">  
                        <%Response.Write(Session("x_Lastname"))%> 
                        </span> 
                    </div> 
                </td> 
            </tr> 
        </table> 
        <table id="tablePageBody" class="tablePageBody">  
        <tr> 
            <td class="tablePageBodyLeftColumn">  
                <telerik:RadPanelBar ID="RadPanelBar1" Runat="server" DataFieldID="DataFieldID"   
                    DataFieldParentID="DataFieldParentID"   
                    DataNavigateUrlField="DataNavigateUrlField" DataSourceID="SqlDataSource1"   
                    DataTextField="DataTextField" DataValueField="DataTextField" Height="100%"   
                    Skin="Forest" Width="180px" ExpandMode="FullExpandedItem"   
                    PersistStateInCookie="True">  
                </telerik:RadPanelBar> 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
        ConnectionString="<%$ ConnectionStrings:CF_SQL_Connection %>"   
        SelectCommand="SELECT [DataFieldID], [DataFieldParentID], [DataTextField], [DataNavigateUrlField], [ImageURL] FROM [CF_Menu_Console]">  
    </asp:SqlDataSource> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
    </telerik:RadScriptManager> 
            </td> 
            <td class="tablePageBodyRightColumn">  
                <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"   
                    DataSourceID="sdsEmployeeList" GridLines="None" Skin="Telerik"   
                    Width="771px">  
                    <mastertableview autogeneratecolumns="False" datasourceid="sdsEmployeeList">  
                        <rowindicatorcolumn> 
                            <HeaderStyle Width="20px" /> 
                        </rowindicatorcolumn> 
                        <expandcollapsecolumn> 
                            <HeaderStyle Width="20px" /> 
                        </expandcollapsecolumn> 
                        <Columns> 
                            <telerik:GridHyperLinkColumn DataNavigateUrlFields="FirstName,IDProfileEmployee"   
                                DataNavigateUrlFormatString="employeedetails.aspx?IDProfileEmployee={1}"   
                                DataTextField="IDProfileEmployee" DataTextFormatString="Details"   
                                Text="View" UniqueName="View">  
                                <ItemStyle Width="50px" /> 
                            </telerik:GridHyperLinkColumn> 
                            <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName"   
                                SortExpression="LastName" UniqueName="LastName">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"   
                                SortExpression="FirstName" UniqueName="FirstName">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Email" HeaderText="Email"   
                                SortExpression="Email" UniqueName="Email">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridHyperLinkColumn DataNavigateUrlFields="IDProfileEmployee,FirstName,LastName"   
                                DataNavigateUrlFormatString="../../../../includes/makeuser.aspx?IDProfileEmployee={0}&amp;FirstName={1}&amp;LastName={2}"   
                                Text="User" UniqueName="AddUser">  
                            </telerik:GridHyperLinkColumn> 
                        </Columns> 
                    </mastertableview> 
                </telerik:RadGrid> 
                <asp:SqlDataSource ID="sdsEmployeeList" runat="server"   
                    ConnectionString="<%$ ConnectionStrings:CF_SQL_Connection %>"   
                    SelectCommand="SELECT [IDProfileEmployee], [IDUser], [LastName], [FirstName], [Email] FROM [CF_Profile_Employee]">  
                </asp:SqlDataSource> 
            </td> 
       </table>           
      
</table> 
      
          
    <table class="tablePageFooter">  
        <tr> 
            <td> 
                <!--#include virtual ="/includes/footer.htm" --></td>  
        </tr> 
    </table> 
    </form> 
</body> 
</html> 
 

Here is my code behind:

 
Imports Telerik.Web.UI  
 
Partial Class cf_console_admin_profiles_employee_employee  
    Inherits System.Web.UI.Page  
 
 
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)  
        If TypeOf e.Item Is GridDataItem Then  
            Dim item As GridDataItem = TryCast(e.Item, GridDataItem)  
            Dim textBox As TextBox = TryCast(item.FindControl("AddUser"), TextBox)  
            If textBox.Text.Length > 0 Then  
                Dim commandItem As GridCommandItem = TryCast(TryCast(sender, RadGrid).MasterTableView.GetItems(GridItemType.CommandItem)(0), GridCommandItem)  
                TryCast(commandItem.FindControl("AddUser"), TextBox).Visible = False 
            End If  
        End If  
    End Sub  
 
End Class  
 

Thank you in advance.
Allan
Top achievements
Rank 2
 answered on 10 Mar 2010
5 answers
167 views
Hi,

We are building a webapplication using the Web Client Software Factory Model-View-Presenter pattern.
We would like to take advantage of the Telerik control library, but we cannot find any samples on how to implement this properly in the MVP pattern using the ObjectContainerDataSource. This is what we would like to do:
1. One page with two RadGrids - in a multipage with a pageview for each grid.
2. The page containing the grids have a save button - when clicking this, the data from the grids should be saved. We don't want a save button for each grid, since this is not very user-friendly.

This is how we have done so far:
1. Insert a RadGrid like this:
<tel:RadGrid ID="gridKnuder" AutoGenerateColumns="false" 
                DataSourceID="ocdsKnuder" AllowPaging="True" AllowSorting="True" AllowMultiRowEdit="true" 
                AllowAutomaticUpdates="true" GridLines="None" Skin="Office2007" 
                OnPreRender="GridKnuder_PreRender" OnItemCreated="GridKnuder_ItemCreated" runat="server"> 
                <MasterTableView DataKeyNames="Kode" EditMode="InPlace" CommandItemDisplay="None"> 
                    <Columns> 
                        <tel:GridBoundColumn ReadOnly="true" UniqueName="ShowType" HeaderText="Type" DataField="TypeBeskrivelse" /> 
                        <tel:GridBoundColumn HeaderText="Pris" UniqueName="ShowPris" DataField="Pris" /> 
                    </Columns> 
                </MasterTableView> 
            </tel:RadGrid> 

2. Declare an ObjectContainerDataSource like this:
<wcsf:ObjectContainerDataSource ID="ocdsKnuder" DataObjectTypeName="Niras.DasVaerdi.Entity.KKnudeStandardVaerdi" runat="server" /> 




3. We display the grid in edit mode like this:
protected void GridKnuder_PreRender(object sender, System.EventArgs e) 
        { 
            if (!IsPostBack) 
            { 
                foreach (GridItem item in gridKnuder.MasterTableView.Items) 
                { 
                    if (item is GridEditableItem ) 
                    { 
                        GridEditableItem editableItem = item as GridDataItem; 
                        editableItem.Edit = true; 
                    } 
                } 
 
                gridKnuder.Rebind(); 
            } 
        } 
 
This makes all the rows in the grid editable when the page is loaded, and when the user clicks the "global" save button, we want to retrive the list of objects that was initially bound to the grid like this:
public IList<OurObject> Knuder 
        { 
            set { ocdsKnuder.DataSource = Session[skKnudeStandardVaerdier] = value; } 
        } 


So, we want our save button event-handler do look something like this:
protected void Save(object sender, EventArgs e) 
        { 
// Get the list of objects back from the grid or its datasource          
IList<OurObject> vaerdier = gridKnuder.???????? or ocdsKnuder.???? 
 
            _presenter.OnKnuderUpdated(vaerdier); 
            Knuder = vaerdier; 
        } 

Is this even possible with the ObjectContainerDataSource or does it only allow updating on row at a time, with "Update" and  "Cancel" option on each row? Which is not vey usefull in real-world applications.

Please let me know if I should provide more code to clarify what we want to do
johnv
Top achievements
Rank 2
 answered on 10 Mar 2010
2 answers
164 views
Hello,
I'm working through a current problem with a page that utilizes a RadGrid along with CustomValidator ASP.NET controls.

When an item is edited inline, the client side validators still somehow allow a postback to occur via 

GridEditCommandColumn

 

column. When this happens, validation fails on the server side and any posted back changes to the form are completely lost (even cells which contained valid data).

I'd like to either be able to 1) Stop the postback on the client side as it *HAS* failed validation or 2) maintain the row's values after the canceled update attempt has occured.

Has anyone seen similar behavior? All client side validation does is set the args.IsValid to true or false and I can confirm this works - but showhow it just allows me to still click the update command item image.

Anthony Romero
Top achievements
Rank 1
 answered on 10 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?