Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
239 views
Hi,

         I am very beginer using rad controls. I have a situation where i want to display the data in grid and need to provide the link to key filed. I need to display the details in new web page when user selet the link in the grid. I am not really sure how i can capture the key field associated to link. below is my code. Can you please help me on this?


Thanks
RP

<

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

AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="10" ShowStatusBar="true" OnItemCommand="RadGrid1_ItemCommand" >

<PagerStyle Mode="NumericPages" />

<MasterTableView Width="100%" >

<Columns>

<telerik:GridButtonColumn DataTextField="DEALER_NUM" CommandArgument="DEALER_NUM" HeaderText="Dealer Number" CommandName="Select">

</telerik:GridButtonColumn>

<telerik:GridHyperLinkColumn

DataNavigateUrlFields= "DEALER_NUM,ROW_ID"

DataNavigateUrlFormatString= "~/Details.aspx?DealerNum={0}&RowID={1}" DataTextField="DEALER_NUM">

</telerik:GridHyperLinkColumn>

</Columns>

</MasterTableView>

<ClientSettings EnablePostBackOnRowClick="true" >

<Selecting AllowRowSelect="True" ></Selecting>

</ClientSettings>

</telerik:RadGrid>

Princy
Top achievements
Rank 2
 answered on 08 Sep 2008
1 answer
96 views
Hi.

every time i do a postback the whole page flashes, do you know why is this happening and how can i make it not noticeable, i have seen in some of yor pages that when a postback is done it is barely noticeable.


thanks in advanced.
Daniel
Telerik team
 answered on 08 Sep 2008
2 answers
68 views
dear all: 
i do this
    public class MyRadGrid : Telerik.Web.UI.RadGrid
    {
but in the designer source the Columns of the MasterTableView can't IntelliSense his children auto.
please help me for these. thank you very much.
nan
Top achievements
Rank 1
 answered on 08 Sep 2008
1 answer
173 views


I am binding a tree to a collection of objects. When the tree is rendered, I would like to display different images before the text of the node,
depending on the type of the node being bound.

I am trying to use the ImageUrlField property to do this, and I receive the following error:

Could not bind to the 'ImageUrlType' property (specified by ImageUrl) while databinding.  Please check the DataBindings fields.

(Otherwise the binding, and the hierarchical view works)
The hierarchy model is implemented based on the following example:
http://www.telerik.com/community/forums/thread/b311D-bdachc.aspx

Here is my code:
Tree.aspx 
        <telerik:RadTreeView ID="RadTreeView1" runat="server" AllowNodeEditing="True"  
            BorderColor="Black" EnableDragAndDrop="True"             
            OnNodeDrop="RadTreeView1_NodeDrop" 
            Skin="Telerik"  
            BorderStyle="Solid" BorderWidth="1px" Height="200px"  
            MultipleSelect="True" onnodeclick="RadTreeView1_NodeClick" Width="280px"
             
            <DataBindings> 
            <telerik:RadTreeNodeBinding 
                  ImageUrlField="ImageUrlType" 
                  /> 
            </DataBindings> 
            .... 

Tree.aspx.cs: 
 
                List<TreeNode> myTreeNodes = new List<TreeNode>(); 
                 
                ... 
 
                RadTreeView1.DataSource = new HierarchicalModelDataSource<TreeNode> { DataSource = myTreeNodes }; 
                RadTreeView1.DataBind(); 
                RadTreeView1.CollapseAllNodes(); 

TreeNode.cs: 
    public class TreeNode : IModelWithHierarchy<TreeNode> 
    { 
        CoreData _coreData; 
        public CoreData CoreDataItem 
        { 
            get { return _coreData; } 
            set { _coreData = value; } 
        } 
 
 
        public TreeNode Parent { get; set; } 
        public List<TreeNode> Children { get; set; } 
 
        public string Name 
        { 
            get 
            { 
                return _coreData.Name; 
            } 
 
            set 
            { 
                ; 
            } 
        } 
         
         
        public string ImageUrlType 
        { 
        get 
        { 
            String directoryImageUrl = "Images/folder.gif"
            String fileImageUrl = "Images/image.png"
 
            if (_coreData.IsDirectory) 
            { 
            return directoryImageUrl; 
            } 
            else if (_coreData.IsFile) 
            { 
            return fileImageUrl; 
            } 
        } 
         }         
    } 

Thank you,
Alex


Alex
Top achievements
Rank 1
 answered on 07 Sep 2008
1 answer
153 views
I have copied the outlook skin to the root of my application, renamed to MySkin, then I editted the CSS file and replace all '_Outlook' with '_MySkin' in the Input.Outlook.css (renamed to Input.Myskin.css).

The aspx code is listed below...

My problem is that when I run the application the textbox does not look like the textbox when Skin is set to "Outlook".

So I cannot even start to customize this skin.

Please advise, I have spend far too many hours on this "simple" task.

<%

@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

 

<%

@ register assembly="Telerik.Web.UI" 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 runat="server">

<title></title>
<link id="Link1" href="~/MySkin/Input.MySkin.css" rel="stylesheet" type="text/css" runat="server" />
</
head>
<
body>
<form id="form1" runat="server">
<div><asp:scriptmanager id="ScriptManager1" runat="server" />
<telerik:radtextbox id="RadTextBox1" runat="server" Skin="MySkin" EnableEmbeddedSkins="False" ></telerik:radtextbox>

</div>
</form>
</
body>
</
html>

Dimo
Telerik team
 answered on 07 Sep 2008
2 answers
96 views
Steps are

1) Using the Table Manager to create a simpe table layout with <thead>

2) The click on edit the table properties, a
pplying Table Border and Color using the editor table properties dialog box , the editor will change the whole table code structure. {Please see sample below

Table codes when first created

<table> 
    <thead> 
        <tr> 
            <th width="50%">Types of Enquiry</th> 
            <th width="20%"> Tel Number</th> 
            <th width="30%">Email Address </th> 
        </tr> 
    </thead> 
    <tbody> 
        <tr> 
            <td><strong>Mount Faber Club</strong> - Activities, facilities and rates</td> 
            <td>6278 6011</td> 
            <td><a href="mailto:mtfaberclub@safra.sg">mtfaberclub@safra.sg</a></td>  
        </tr> 
        <tr> 
            <td><strong>Toa Payoh Club</strong> - Activities, facilities and rates  </td> 
            <td>6259 4000</td> 
            <td><a href="mailto:tpclub@safra.sg">tpclub@safra.sg</a> </td> 
        </tr> 
        <tr> 
            <td><strong>Tampines Club</strong> - Activities, facilities and rates</td> 
            <td>6785 8800</td> 
            <td><a href="mailto:tmclub@safra.sg">tmclub@safra.sg</a>  </td> 
        </tr> 
    </tbody> 
</table> 
<br />  

Table Codes after creation (* not all the <td> has been replaced by <th> *)
<table bordercolor="#666666" border="1">  
    <thead> 
        <tr> 
            <th width="50%">Types of Enquiry</th> 
            <th width="20%"> Tel Number</th> 
            <th width="30%">Email Address </th> 
        </tr> 
    </thead> 
    <tbody> 
        <tr> 
            <th><strong>Mount Faber Club</strong> - Activities, facilities and rates</th> 
            <th>6278 6011</th> 
            <th><a href="mailto:mtfaberclub@safra.sg">mtfaberclub@safra.sg</a></th>  
        </tr> 
        <tr> 
            <th><strong>Toa Payoh Club</strong> - Activities, facilities and rates  </th> 
            <th>6259 4000</th> 
            <th><a href="mailto:tpclub@safra.sg">tpclub@safra.sg</a> </th> 
        </tr> 
        <tr> 
            <th><strong>Tampines Club</strong> - Activities, facilities and rates</th> 
            <th>6785 8800</th> 
            <th><a href="mailto:tmclub@safra.sg">tmclub@safra.sg</a>  </th> 
        </tr> 
    </tbody> 
</table> 
<br /> 

sunburnsam
Top achievements
Rank 1
 answered on 07 Sep 2008
1 answer
96 views
I am programming a radScheduler application where you have to register and login to view, create and update new appointments. I have set these properties to radScheduler on login.

            RadScheduler1.AllowDelete = false;
            RadScheduler1.AllowEdit = false;
            RadScheduler1.AllowInsert = true; 

// I also have a code that allows users to create appointments just under their UserID

Of course every registered user can only edit and delete his own appointments, so i have created RadScheduler1_AppointmentCreated event, which occurs for every event existing in the current view.

    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        if (Session["logiran"] != null)
        {
            if (Int32.Parse(Session["status"].ToString()) != 1)
            {
                foreach (Resource resource in e.Appointment.Resources)
                {
                    if (resource.Type == "Uporabnik")
                    {
                        if (resource.Key.ToString() == Session["UserID"].ToString())
                        {
                            e.Appointment.AllowEdit = true;
                            e.Appointment.AllowDelete = true;

                        }
                    }
                }
            }
        }
    }

Everything works fine, I can edit, delete, move the appointment, except for the grabber, which allows the user to resize the appointment. Grabber is just not shown. 

I am working on this problem for 2 days now, and I am getting tired of it, so I would be pleased if someone helps me on this one! I just can't fix it.

thanks in advance, Luka


Lukrs
Top achievements
Rank 2
 answered on 07 Sep 2008
2 answers
472 views

This code will throw an exception:

                        GridDataItem dItem = e.Item as GridDataItem;  
                        // rename edit button  
                        TableCell cell = dItem["cmdEdit"];  
                        if (cell != null)  
                        {  
                            Control control = cell.Controls[0];  
                            if (control != null)  
                            {  
                                LinkButton cmdEdit = control as LinkButton;  
                                cmdEdit.Text = "View";  
                            }  
                        }  
 

Instead of handling exceptions, I would rather prefer to check if the column exists prior to accessing it. I couldn't find any simple way of checking column existense by unique name.

Why don't you introduce a method GridDataItem.ContainsColumn(uniqueName) ?

Eliyahu Goldin
Top achievements
Rank 1
 answered on 07 Sep 2008
2 answers
602 views
Hi

  I am using RadtoolBar in a user control(.ascx) page.Allthough i can see the button on the Page and access its javascript methods and properties , the server side click event is not firing.
Below is my Code

The user control code
NotesControl.ascx

<asp:Panel ID="Panel6" runat="server" Height="95%" Width="100%">

<telerik:RadToolBar ID="RadSmallToolBar1" runat="server" Skin="Office2007" Width="650px" OnButtonClick="RadSmallToolBar1_Click" >

<Items>

<telerik:RadToolBarButton runat="server" PostBack="true" ImagePosition="Left" CausesValidation="false" DisabledImageUrl="~/Images/16x16/Save.gif" ImageUrl="~/Images/16x16/Save.gif" Value="Submit" Text="Save"></telerik:RadToolBarButton>

</Items>

</telerik:RadToolBar>

</asp:Panel>

Notecontrol.ascx.cs

protected void RadSmallToolBar1_Click(object sender, Telerik.Web.UI.RadToolBarEventArgs e)

{.....................

}

masterpage.aspx

<radts:PageView ID="Page05" runat="server">

<asp:Panel ID="Panel6" runat="server">

<div style="background: url(../../Images/bg.jpg) no-repeat;">

<div class="Header">

Notes:

</div>

</div>

<div style="padding-bottom: 0.25in">

<rad:RadAjaxPanel ID="NotesAjaxPanel" runat="server" EnableAJAX="true">

<asp:Panel ID="NotesLoadingPanel" runat="server" Width="100%">

</asp:Panel>

</rad:RadAjaxPanel>

</div>

</asp:Panel>


masterpage.cs

private void GetNotes()

{

Control notes = this.LoadControl("~/FormContainers/NotesControl.ascx");

this.NotesLoadingPanel.Controls.Add(notes);

}


i tested with asp button and it is firing the clickevent but when i replace with toolbar the event is not firing.


Thanks
Baqi

Kasper Bergmann
Top achievements
Rank 1
 answered on 06 Sep 2008
0 answers
69 views
hi
 I m using .net 3,.5 with linqtosql i want to bind multiple datatable  with rad combo box,
 Plz Help ME
  Rakesh

 Thanks
Rakesh
Top achievements
Rank 1
 asked on 06 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?