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

     I am using RadGrid to display items.But for editing of grid data, I am using a webuserControl . The webusercontrol works fine.
But as per the project requiremnt, I have to show the edit form/webusercontrol along with grid data in the bottom half of the page. The web user control would show the edit form for the selected grid item.

Grid page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CreateIDR.aspx.cs" Inherits="POPS.State.DHH.IDR.CreateIDR" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!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></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
    <telerik:RadScriptManager ID="ScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
       <!-- content start --> 
       <div style="height: 100%; padding: 10px">  
      
       <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" /> 
       <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" /> 
         
    
             
     <telerik:RadGrid ID="RadGrid1"  runat="server"     
     GridLines="None" AllowPaging="True" AllowSorting="True"   
     AutoGenerateColumns="False"   
     Width="97%"   
     OnNeedDataSource="RadGrid1_NeedDataSource"   
     OnDeleteCommand="RadGrid1_DeleteCommand"   
     OnInsertCommand="RadGrid1_InsertCommand"   
     OnUpdateCommand="RadGrid1_UpdateCommand"   
     OnPreRender="RadGrid1_PreRender"   
     OnItemCommand="RadGrid1_ItemCommand"   
     OnItemCreated="RadGrid1_ItemCreated"   
     OnColumnCreated="RadGrid1_ColumnCreated"   
     AllowFilteringByColumn="True">    
           <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>    
                
           <MasterTableView DataKeyNames="IDR_ID" GridLines="None" Width="100%" CommandItemDisplay ="Top" >    
                
               <Columns>    
                   <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete">     
                   </telerik:GridButtonColumn>    
                   <telerik:GridBoundColumn DataField="IDR_ID" HeaderText="IDRID" UniqueName="IDR_ID" ReadOnly="True">     
                   </telerik:GridBoundColumn>    
                   <telerik:GridBoundColumn DataField="REQUESTOR_TITLE" HeaderText="Requestor Title" UniqueName="IDR_TYPE">     
                   </telerik:GridBoundColumn>    
                   <telerik:GridBoundColumn DataField="REQUESTOR_FIRST_NAME" HeaderText="Requestor First Name" UniqueName="IDR_SUBTYPE">     
                   </telerik:GridBoundColumn>    
                   <telerik:GridBoundColumn DataField="REQUESTOR_LAST_NAME" HeaderText="Requestor Last Name" UniqueName="REQUESTED_BY">     
                   </telerik:GridBoundColumn>    
                                       
                   <telerik:GridEditCommandColumn>    
                   </telerik:GridEditCommandColumn>    
               </Columns>    
               <EditFormSettings UserControlName="IDRInsertFormUserControl.ascx" EditFormType="WebUserControl">     
                   <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">     
                   </EditColumn>    
                     
               </EditFormSettings>    
               <ExpandCollapseColumn Visible="False">     
                   <HeaderStyle Width="19px"></HeaderStyle>    
               </ExpandCollapseColumn>    
               <RowIndicatorColumn Visible="False">     
                   <HeaderStyle Width="20px" />    
               </RowIndicatorColumn>    
           </MasterTableView>    
             
       </telerik:RadGrid> 
         
   <telerik:RadSplitter ID="RadSplitter1" runat="server" skin="Office2007">       
      <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> 
        
           <telerik:RadPane ID="RadPane1" runat="server">  
                    
                /////Here  the edit form should show //////////////////////                
            </telerik:RadPane> 
                 
    </telerik:RadSplitter> 
    </div> 
    </form> 
</body> 
</html> 
 




Any idea?

Thanks,
Rita
Princy
Top achievements
Rank 2
 answered on 03 Mar 2010
3 answers
136 views
Hi,
I've been having issues since i have updated from Q2 2009 to Q3 2009.  Tha major problem at the moment is happening at design time.

When i have a control on an ASPX page, like a panelbar, i select the panelbar in the design view and in the Properties window i select the Items collection option and add in a number of items.  I click on OK and the new items i have entered display in the Design time view fine.  The problem is that if i switch to the Source view, the items are not there.  Nor are the items displayed when i compile and run the application.
However, even after running the page and going back to the design view, the designer shows the items still there, but they still are not in the Source view.

I have found i can force to Source to be updated if i use the Smart tag and change the Skin or edit a template (the Smart tag still shows all the items i add in the template list for editting).

Any ideas?

I have uninstalled all Telerik version and reinstalled from scratch to no avail. 

Thanks
Jordan
Rhyss
Top achievements
Rank 1
 answered on 03 Mar 2010
1 answer
230 views

I having problems getting my Master/Detail grids to work. I have a page with two separate grids. Grid1 is the master and uses NeedDataSource to get it's data.   Grid2 is the detail grid and will also use the NeedDataSource to get its data.  Similar to this example:http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx.  However, the example doesn't use NeedDataSource it uses client side declared datasources.

Grid1 (Master) is working fine(Retrieve data / Add/Update/Delete).  But I'm not sure how to connect the Master grid to the Detail.  I have turned on postbackonrowclick in Grid1.   I was thinking I could call Grid2.Rebind() (Detail) in Grid1_NeedDataSource (Master) and pick up the Grid1.SelectedValue (Master's selected value) in Grid2_NeedDataSource (Detail) and pass it to my datalayer and everything will be good.  But this doesn't work. I'm getting an object reference not found on Grid1.SelectedValue on page load.  I'm guessing that's because nothing is selected on page load. ( I figured if nothing was selected it would return 0).   What's the best way to get this to work??
Grids:

                        <telerik:RadGrid ID="Grid1" runat="server" Width="95%" GridLines="None"   
                            AutoGenerateColumns="False" PageSize="13" AllowPaging="True" AllowSorting="True"  AllowMultiRowSelection="false" AllowMultiRowEdit="false"   
                            OnUpdateCommand="ULNGrid_UpdateCommand" OnNeedDataSource="ULNGrid_NeedDataSource" OnItemDataBound="ULNGrid_ItemDataBound" 
                            ShowStatusBar="true" ShowGroupPanel="false" OnInsertCommand="ULNGrid_InsertCommand" OnDeleteCommand="ULNGrid_DeleteCommand" Skin="Outlook" Visible="true" > 
                            <MasterTableView DataKeyNames="Userlistnameid" Width="100%" CommandItemDisplay="TopAndBottom" EditMode="InPlace">  
 
                                <Columns> 
                                    <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"  />                                  
                                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" MaxLength="200" UniqueName="Name">  
                                    <ItemStyle Width="400px" />                                    
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridDropDownColumn HeaderText="User List Type" UniqueName="UserListTypeddl" ListTextField="Name" ListValueField="Userlisttypeid" DataField="Userlisttypeid" 
                                 SortExpression="Userlisttypeid" DropDownControlType="DropDownList" FooterText="RadComboBox column footer" DataSourceID="SqlDsUserListTypeIdAll">  
                                    </telerik:GridDropDownColumn>    
                            <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel" EditText="Edit">  
                                <HeaderStyle Width="85px"></HeaderStyle> 
                            </telerik:GridEditCommandColumn>                                                                        
 
                                </Columns> 
                            </MasterTableView> 
                            <ClientSettings EnablePostBackOnRowClick="true" > 
                                <Selecting AllowRowSelect="True"  />                               
                            </ClientSettings> 
                        </telerik:RadGrid> 
//******************************************************************************  
 
 
                        <telerik:RadGrid ID="Grid2" runat="server" Width="95%" GridLines="None"   
                            AutoGenerateColumns="False" PageSize="13" AllowPaging="True" AllowSorting="True"  AllowMultiRowSelection="false" AllowMultiRowEdit="false"   
                            OnUpdateCommand="ULCGrid_UpdateCommand" OnNeedDataSource="ULCGrid_NeedDataSource" OnItemDataBound="ULCGrid_ItemDataBound" 
                            ShowStatusBar="true" ShowGroupPanel="false" OnInsertCommand="ULCGrid_InsertCommand" OnDeleteCommand="ULCGrid_DeleteCommand" Skin="Outlook" Visible="true" > 
                            <MasterTableView DataKeyNames="Userlistcodeid" Width="100%" CommandItemDisplay="TopAndBottom" EditMode="InPlace">  
 
                                <Columns> 
                                    <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"  />                                  
                                    <telerik:GridBoundColumn DataField="Code" HeaderText="Code" MaxLength="32" UniqueName="Code">  
                                    <ItemStyle Width="400px" />                                    
                                    </telerik:GridBoundColumn> 
                                     <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel" EditText="Edit">  
                                        <HeaderStyle Width="85px"></HeaderStyle> 
                                    </telerik:GridEditCommandColumn>                                                                        
 
                                </Columns> 
                            </MasterTableView> 
                            <ClientSettings > 
                                <Selecting AllowRowSelect="True"  />                               
                            </ClientSettings> 
                        </telerik:RadGrid> 

Code:

Grid1:  
        public List<UserListName> GetULNList()  
        {  
            List<UserListName> ulnlist = UserListName.getAll();  
            return ulnlist;  
        }  
 
        protected void Grid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            Grid1.DataSource = GetULNList();  
            Grid2.Rebind()  
        }  
 
 
 
//*******************************************************************************  
        public List<UserListCode> GetULCList()  
        {  
            string strulnid = Grid1.SelectedValue.ToString();  
            int ulnid = 0;  
            Int32.TryParse(strulnid, out ulnid);  
 
 
 
 
            List<UserListCode> ulclist = UserListCode.getbyKey(ulnid);  
            return ulclist;  
        }  
 
        protected void Grid2_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            Grid2.DataSource = GetULCList();  
        } 

Thanks

Princy
Top achievements
Rank 2
 answered on 03 Mar 2010
1 answer
112 views
Hello,

I am using a grid control with a user control for editing the data. The Grid also allows multi editing and is using Paging.

I want to automatically save any changes that are in my edit control when someone navigates off the page or causes a postback. Here is the code I am using to gain access to my control for saving, but it always returns “Nothing.”

VB Code To Get Handle to UserControl:

        For Each gi As GridEditableItem In dgIVG.EditItems 
            Dim MyUserControl As PatientDetails = CType(gi.FindControl("ctrlPatientDetails"), PatientDetails) 
            If MyUserControl IsNot Nothing Then 
                If Not MyUserControl.SaveData() Then 
                    MyUserControl.MessageErrorVisible = True 
                    Exit Sub 
                End If 
            End If 
        Next 
 

ASPX Code

    <telerik:RadGrid id="dgIVG" runat="server" Width="750px" AllowPaging="false" GridLines="None" AllowMultiRowEdit="false" Visible="false" Skin="Web20" > 
    <MasterTableView AutoGenerateColumns="False" NoMasterRecordsText="There are no patients that match the filter criteria." DataKeyNames="ID" > 
        <AlternatingItemStyle HorizontalAlign="Left" /> 
        <HeaderStyle BackColor="#5d7b9d" ForeColor="White"  /> 
        <ItemStyle HorizontalAlign="Left" /> 
         
        <Columns> 
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="View" /> 
            <telerik:GridTemplateColumn HeaderText="" Visible="false"> 
                <ItemTemplate> 
                    <asp:Label id="lblAppointmentID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ID") %>'></asp:Label> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
              
            <telerik:GridTemplateColumn HeaderText="Med Rec #"> 
                <ItemTemplate> 
                    <asp:Label id="lblMedRecNo" runat="server" Width="80px" Text='<%#DataBinder.Eval(Container, "DataItem.MedRecNo") %>'></asp:Label> 
                </ItemTemplate> 
                 
                <EditItemTemplate> 
                    <uc4:PatientDetails ID="ctrlPatientDetails" runat="server"  
                    AppointmentID='<%# DataBinder.Eval(Container, "DataItem.ID") %>' 
                     /> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
                       
            <telerik:GridTemplateColumn HeaderText="Patient Name"> 
                <ItemTemplate> 
                    <asp:Label id="lblPtName" runat="server" Width="150px" Text='<%# DataBinder.Eval(Container, "DataItem.PtName") %>'></asp:Label> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
 
            <telerik:GridTemplateColumn HeaderText="Appt Date"> 
                <ItemTemplate> 
                    <asp:Label id="lblApptDate" runat="server" Width="80px" Text='<%# DateTime.Parse(DataBinder.Eval(Container, "DataItem.ApptDate")).ToShortDateString %>'></asp:Label> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
 
            <telerik:GridTemplateColumn HeaderText="Original Verification Result"> 
                <ItemTemplate> 
                    <asp:Label id="lblOrigVerificationResult" runat="server" Width="150px" Text='<%# GetFriendlyOrigVerificationResult(DataBinder.Eval(Container, "DataItem.OrigVerificationResult")) %>'></asp:Label> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
 
            <telerik:GridTemplateColumn HeaderText="Location"> 
                <ItemTemplate> 
                    <asp:Label id="lblLocation" runat="server" Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem.Location") %>'></asp:Label> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn>     
 
            <telerik:GridTemplateColumn HeaderText="Insurance Plan"> 
                <ItemTemplate> 
                    <asp:Label id="lblInsPlan" runat="server" Width="100px" Text='<%# GetFriendlyInsurancePlan(DataBinder.Eval(Container, "DataItem.InsPlan")) %>'></asp:Label> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
         
        </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
 

Is there something I’m missing?

Thanks,

Don Tompkins
Princy
Top achievements
Rank 2
 answered on 03 Mar 2010
1 answer
88 views
I'm using RadGrid Ajax Q3 2009.  I can't believe I'm having trouble with something so simple.  All I want to do is retrieve a value of a non-editable cell for a row in edit mode. 

Using the Update or Item Command event to get the value

GridDataItem

 

dataitem = e.Item as GridDataItem;

 

string mycell = dataitem["MyColumn"].Text;

always gives mycell with a value of  "&nbsp;"

What the hey am I doing wrong??
Shinu
Top achievements
Rank 2
 answered on 03 Mar 2010
1 answer
114 views
Hi Team,

How can I bind radGrid programmatically without using any datasource declaratively
Could you please provide me with a sample for the same...
Similar to the demo on ur site:http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx

 we need to create a demo with all radControls with Adapters
This is something urgent
Kindly provide me with a sample..
Princy
Top achievements
Rank 2
 answered on 03 Mar 2010
4 answers
170 views
Hi Telerik Team,

How to Display Current Week on first Row.

I have RAD Scheduler which have very less height, its showing first two rows of the Scheduler. My Requirement is to show Current Week on the First Row. How it is possible to do?

Please help me in this situation.

Amol Wable


Hiten
Top achievements
Rank 1
 answered on 03 Mar 2010
1 answer
64 views
Hi,

I'm currently building a controls library demo site for my company.  I really like the silverlight demo that Telerik has.  I have already implemented the transition effects.  What i'm curious about is the background image for the overall page.  It appears to be an image that auto scales with the browser window.  Can you tell me what that is?  Are you building an image using xaml somehow or is that one big image and you have figured out a way to have it scale?

Thanks

John Keath
John
Top achievements
Rank 1
 answered on 02 Mar 2010
1 answer
103 views
I'm using a RadTabStrip that contains RadTabs with Silverlight grids (RadGridView). The grids are configured with validators. On postback while attempting to save to the database I'm having the following issue: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. The Java script debugger breaks on the d.focus() call in the script segment below. This segement is from RadInputControl.js from Telerik.Web.UI. d is the Silverlight grid and its offsetWidth is 0 at this point. Also, this grid is not on the current visible tab. Let me know if you need more information.

Thanks, Mike Fernandez

if(typeof(ValidatorSetFocus)=="function"){  
   ValidatorSetFocus=function(f,c){  
        var d;  
        if(typeof(f.controlhookup)=="string"){  
            var a;  
            if((typeof(c)!="undefined")&&(c!=null)){  
                if((typeof(c.srcElement)!="undefined")&&(c.srcElement!=null)){  
                   a=c.srcElement;  
                }  
                else{  
                   a=c.target;  
                }  
           }  
           if((typeof(a)!="undefined")&&(a!=null)&&(typeof(a.id)=="string")&&(a.id==f.controlhookup)){  
               d=a;  
           }  
        }  
        if((typeof(d)=="undefined")||(d==null)){  
            d=document.getElementById(f.controltovalidate);  
        }  
        var b=false;  
        if((d.style)&&(typeof(d.style.visibility)!="undefined")&&(d.style.visibility=="hidden")&&  
        (typeof(d.style.width)!="undefined")&&(document.getElementById(d.id+"_text")||  
        document.getElementById(d.id+"_dateInput_text"))&&(d.tagName.toLowerCase()=="input"||  
        d.tagName.toLowerCase()=="textarea")){  
            b=true;  
        }  
        if((typeof(d)!="undefined")&&(d!=null)&&(d.tagName.toLowerCase()!="table"||(typeof(c)=="undefined")  
            ||(c==null))&&((d.tagName.toLowerCase()!="input")||(d.type.toLowerCase()!="hidden"))&&  
            (typeof(d.disabled)=="undefined"||d.disabled==null||d.disabled==false)&&(typeof(d.visible)=="undefined"||  
            d.visible==null||d.visible!=false)&&(IsInVisibleContainer(d)||b)){  
            if(d.tagName.toLowerCase()=="table"&&(typeof(__nonMSDOMBrowser)=="undefined"||__nonMSDOMBrowser)){  
                var g=d.getElementsByTagName("input");  
                var e=g[g.length-1];  
                if(e!=null){  
                    d=e;  
                }  
            }  
            if(typeof(d.focus)!="undefined"&&d.focus!=null){  
                if(b&&document.getElementById(d.id+"_text")){  
                    document.getElementById(d.id+"_text").focus();  
                }  
                else {  
                    if(b&&document.getElementById(d.id+"_dateInput_text")){  
                        document.getElementById(d.id+"_dateInput_text").focus();  
                    }  
                    else{  
                        d.focus();  //breaks here.
                    }  
                }  
                Page_InvalidControlToBeFocused=d;  
            }  
        }  
    };  
} 
Michael Fernandez
Top achievements
Rank 1
 answered on 02 Mar 2010
4 answers
178 views
Hello ...
In my application uses a Telerik Grid, where I edit the information and insert new information in a pop-up.
In the Grid FormTemplate use various web controls including use 2 DropDownList that recharge selected based on what one of them. I'm teniedno problem is I can not retrieve the DropDownList value selected in the primary.
I leave an example of my code


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting>
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CveUsuario">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CveEstado">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Desde">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Hasta">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="IdGenero">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="IdClasificacion" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="IdGenero">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="IdClasificacion">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CollapsiblePanelExtender1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridNotas" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Sunset" />
    <div style="width:800px; height:auto;">
        <table width="100%" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1"
                        runat="server"
                        TargetControlID="Panel1"
                        ExpandedSize="120"
                        CollapsedSize="0"
                        Collapsed="false"
                        ScrollContents="false"   
                        ExpandControlID="TituloPanel"
                        CollapseControlID="TituloPanel"
                        CollapsedText="Filtrar Notas (Expandir...)"
                        ExpandedText="Filtrar Notas (Ocultar...)"
                        AutoCollapse="false"
                        AutoExpand="False"
                        ImageControlID="Image1"
                        ExpandedImage="../Images/Botones/collapse.jpg"
                        CollapsedImage="../Images/Botones/expand.jpg"
                        ExpandDirection="Vertical"
                        SuppressPostBack="true">
                    </cc1:CollapsiblePanelExtender>
                    <asp:Panel ID="TituloPanel" runat="server">
                        <div style="width:100%; height:23px ; float:left; background-image:url('../Images/Botones/Fondo-Notas.png'); background-repeat:repeat ; text-align:left;">
                            <asp:ImageButton runat="server" ID="image1" Height="15px" ImageAlign="AbsBottom"  />&nbsp;&nbsp;       
                            <asp:Label runat="server" ID="Label1" Text="Filtrar Notas" Font-Bold="True" ForeColor="WhiteSmoke" Font-Size="Large"/>
                        </div>
                    </asp:Panel>        
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel runat="server" ID="Panel1" Width="100%">
                    <table  style="width:100%; background-image:url('../Images/Botones/fd_dgnotamain.jpg');">
                        <tr>
                            <td align="right" style="width:120px">
                                <asp:Label ID="Label2" Font-Bold="true" runat="server" Text="Comentaristas:" />
                            </td>
                            <td align="left" style="width:200px">
                                <asp:DropDownList ID="CveUsuario"
                                    runat="server"
                                    AutoPostBack="true"
                                    DataSourceID="ComentaristasDB"
                                    DataTextField="Nombre"
                                    DataValueField="CveUsuario"
                                    TabIndex="1">
                                </asp:DropDownList>
                            </td>
                            <td align="right" style="width:120px">
                                <asp:Label ID="Label4" Font-Bold="true" runat="server" Text="Estado:" />
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="CveEstado"
                                    runat="server"
                                    AutoPostBack="true"
                                    TabIndex="2"
                                    AppendDataBoundItems="true">
                                    <asp:ListItem Value="1" Text="Activo" />
                                    <asp:ListItem Value="3" Text="Eliminado" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width:120px">
                                <asp:Label ID="Label3" Font-Bold="true" runat="server" Text="Desde:" />
                            </td>
                            <td align="left" style="width:200px">
                                <telerik:RadDatePicker ID="Desde"
                                    runat="server"
                                    Culture="Spanish (Argentina)"
                                    MinDate="2008-01-01"
                                    Width="100px"
                                    TabIndex="3"
                                    Skin="Hay"
                                    AutoPostBack="true">
                                </telerik:RadDatePicker>
                            </td>
                            <td align="right" style="width:120px">
                                <asp:Label ID="Label5" Font-Bold="true" runat="server" Text="Hasta:" />
                            </td>
                            <td align="left">
                                <telerik:RadDatePicker ID="Hasta"
                                    runat="server"
                                    Culture="Spanish (Argentina)"
                                    MinDate="2008-01-01"
                                    Width="100px"
                                    TabIndex="4"
                                    Skin="Hay"
                                    AutoPostBack="true">
                                </telerik:RadDatePicker>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="width:120px">
                                <asp:Label ID="Label6" Font-Bold="true" runat="server" Text="Genero:" />
                            </td>
                            <td align="left" style="width:200px">
                                <asp:DropDownList ID="IdGenero"
                                    runat="server"
                                    DataSourceID="GeneroDB"
                                    DataTextField="Descripcion"
                                    DataValueField="IdGenero"
                                    TabIndex="5"
                                    AutoPostBack="true"
                                    AppendDataBoundItems="true">
                                    <asp:ListItem Value="999" Text="Todos"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td align="right" style="width:120px">
                                <asp:Label ID="Label7" Font-Bold="true" runat="server" Text="Clasificacion:" />
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="IdClasificacion"
                                    runat="server"
                                    AutoPostBack="true"
                                    DataSourceID="ClasificaionDB"
                                    DataTextField="Descripcion"
                                    DataValueField="IdClasificacion"
                                    TabIndex="6"
                                    AppendDataBoundItems="true">
                                    <asp:ListItem Value="999" Text="Todos"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br /><br />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                </td>
            </tr>
        </table>
        <table width="100%" cellpadding="0" cellspacing="2">  
            <tr>
                <td align="left">
                    <telerik:RadGrid ID="GridNotas"
                    runat="server"
                    Width="100%"
                    DataSourceID="NotasDb"
                    GridLines="None"
                    AllowMultiRowEdit="false"
                    AllowAutomaticUpdates="true"
                    AllowAutomaticInserts="true"
                    AllowAutomaticDeletes="true"   
                    AllowFilteringByColumn="false"
                    AllowSorting="true"
                    AllowPaging="True"
                    PageSize="15"
                    AutoGenerateColumns="false"
                    ShowStatusBar="true"
                    Skin="Sunset">
                    <MasterTableView
                        DataSourceID="NotasDb"
                        DataKeyNames="CveNota"
                        CommandItemDisplay="Top"
                        EditMode="PopUp"  
                        ShowFooter="true"
                        Width="100%"
                        HeaderStyle-HorizontalAlign="Center">
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton"                         HeaderText="Editar"         HeaderStyle-Width="40px" />
                            <telerik:GridBoundColumn UniqueName="Titulo"        DataField="Titulo"          HeaderText="Titulo"         HeaderStyle-Width="250px" AllowFiltering="false"/>
                            <telerik:GridBoundColumn UniqueName="Coment"        DataField="Coment"          HeaderText="Comentario"     HeaderStyle-Width="250px" AllowFiltering="false"/>
                            <telerik:GridBoundColumn UniqueName="Estado"        DataField="Estado"          HeaderText="Estado"         HeaderStyle-Width="50px"  AllowFiltering="false"/>
                            <telerik:GridBoundColumn UniqueName="Genero"        DataField="Genero"          HeaderText="Genero"         HeaderStyle-Width="70px"  AllowFiltering="false"/>
                            <telerik:GridBoundColumn UniqueName="Clasificacion" DataField="Clasificacion"   HeaderText="Clasificacion"  HeaderStyle-Width="70px"  AllowFiltering="false"/>
                            <telerik:GridTemplateColumn AllowFiltering="false"  DataField="CveNota"         HeaderText="Fotos"         HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:HyperLink runat="server"
                                        ID="Fotos"
                                        NavigateUrl='<%# "~/Eliminar/Eliminar.aspx?form=Notas&CveNota=" & Eval("CveNota")%>'
                                        ToolTip="Agregar Foto"
                                        ImageUrl="~/Images/Botones/foto.PNG"  >
                                    </asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false"  DataField="CveNota"         HeaderText="Eliminar"         HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:HyperLink runat="server"
                                        ID="Eliminar"
                                        NavigateUrl='<%# "~/Carga/Fotos.aspx?CveNota=" & Eval("CveNota") %>'
                                        ToolTip="Eliminar Nota"
                                        ImageUrl="~/Images/Botones/Eliminar.png" >
                                    </asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <EditFormSettings
                            PopUpSettings-Modal="true" PopUpSettings-Width="800" EditFormType="Template"
                            CaptionDataField="CveNota" CaptionFormatString="Editar Nota: {0}" >
                            <FormTemplate>
                                <table style="background-color:#eeeeee; vertical-align:top;" cellpadding="1" cellspacing="1" width="800">
                                    <tr>
                                        <td align="right">
                                            <b>CveNota: &nbsp;<%# Eval("CveNota") %></b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" >
                                            <b>*Volanta:</b>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="Volanta" runat="server" Text='<%# Bind("Volanta") %>' MaxLength="200" Width="600px" TabIndex="1" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:RequiredFieldValidator ID="VVolanta" runat="server"
                                                ControlToValidate="Volanta"
                                                ErrorMessage="Debe ingresar la Volanta de la Nota."
                                                Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <b>*Titulo:</b>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="Titulo" runat="server" Text='<%# Bind("Titulo") %>' MaxLength="200" Width="600px" TabIndex="2" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:RequiredFieldValidator ID="VTitulo" runat="server"
                                                ControlToValidate="Titulo"
                                                ErrorMessage="Debe ingresar el Titulo de la Nota."
                                                Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <b>*Comentario:</b>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="Comentario" runat="server"
                                                Text='<%# Bind("Comentario") %>'
                                                TextMode="MultiLine"
                                                MaxLength="1000"
                                                Width="600px"
                                                Height="120px"
                                                TabIndex="3" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:RequiredFieldValidator ID="VComentario" runat="server"
                                                ControlToValidate="Comentario"
                                                ErrorMessage="Debe ingresar el Comentario de la Nota."
                                                Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="top">
                                            <b>*Nota:</b>
                                        </td>
                                        <td align="left">
                                            <telerik:RadEditor ID="Nota"
                                                runat="server"
                                                Content='<%# Bind("Nota")%>'
                                                Height="700px"
                                                Width="680px"
                                                TabIndex="4"
                                                ToolbarMode="ShowOnFocus" >
                                                <Tools>
                                                    <telerik:EditorToolGroup >
                                                        <telerik:EditorTool Name="Cut" />
                                                        <telerik:EditorTool Name="Copy" />
                                                        <telerik:EditorTool Name="Paste" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="Bold" />
                                                        <telerik:EditorTool Name="Italic" />
                                                        <telerik:EditorTool Name="Underline" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="Fontname" />
                                                        <telerik:EditorTool Name="FontSize" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="JustifyLeft"  />
                                                        <telerik:EditorTool Name="JustifyCenter"  />
                                                        <telerik:EditorTool Name="JustifyRight"  />
                                                        <telerik:EditorTool Name="JustifyFull"  />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="Undo" />
                                                        <telerik:EditorTool Name="Redo" />
                                                        <telerik:EditorSeparator Visible="true" />
                                                        <telerik:EditorTool Name="ForeColor" />
                                                        <telerik:EditorTool Name="BackColor" />
                                                    </telerik:EditorToolGroup>
                                                </Tools>        
                                                <Modules>
                                                    <telerik:EditorModule Name="RadEditorStatistics" />
                                                </Modules>
                                            </telerik:RadEditor>
                                        </td>
                                    </tr>
                                    <tr>
                                         <td align="center" colspan="2">
                                            <asp:RequiredFieldValidator ID="VNota" runat="server"
                                                ControlToValidate="Nota"
                                                ErrorMessage="Debe ingresar la Nota."
                                                Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <b>*Genero:</b>
                                        </td>    
                                        <td align="left">
                                            <asp:DropDownList ID="IdGenero"
                                                runat="server"
                                                DataTextField="Descripcion"
                                                DataValueField="IdGenero"
                                                AutoPostBack="true"
                                                SelectedValue='<%# Bind("IdGenero") %>'
                                                DataSource='<%# func.GetSqlDataSource("SELECT [IdGenero], [Descripcion] FROM [Genero]") %>'
                                                AppendDataBoundItems="True"
                                                OnSelectedIndexChanged="IdGenero_SelectedIndexChanged"
                                                TabIndex="5">
                                                <asp:ListItem Value="">Elija el Genero</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="VIdGenero" runat="server"
                                                ControlToValidate="IdGenero"
                                                ErrorMessage="Debe ingresar el Genero."
                                                Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <b>*Clasificación:</b>
                                        </td>    
                                        <td align="left">
                                            <asp:DropDownList ID="IdClasificacion"
                                                runat="server"
                                                DataTextField="Descripcion"
                                                DataValueField="IdClasificacion"
                                                DataSourceID="IdClasificacionDB"
                                                selectedValue='<%# Bind("IdClasificacion") %>'
                                                AppendDataBoundItems="True" >
                                                <asp:ListItem Value="">Elija la Clasificacion</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="VIdClasificacion" runat="server"
                                                ControlToValidate="IdClasificacion"
                                                ErrorMessage="Debe ingresar la Clasificacion."
                                                Display="Dynamic">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:Button ID="Button1" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'
                                                runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
                                            </asp:Button>&nbsp;
                                            <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"/>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
                        </MasterTableView>
                    </telerik:RadGrid>                
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="ComentaristasDB" runat="server" ConnectionString="<%$ ConnectionStrings:OpiDeportivaConnectionString %>"
        SelectCommand="SELECT CveUsuario, Nombres+' '+Apellidos AS Nombre FROM Users WHERE CveEstado=1 AND CveTipo IN (1,2)">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="EstadoDB" runat="server" ConnectionString="<%$ ConnectionStrings:OpiDeportivaConnectionString %>"
        SelectCommand="SELECT CveEstado, Descripcion FROM States">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="GeneroDB" runat="server" ConnectionString="<%$ ConnectionStrings:OpiDeportivaConnectionString %>"
        SelectCommand="SELECT IdGenero, Descripcion FROM Genero">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="ClasificaionDB" runat="server" ConnectionString="<%$ ConnectionStrings:OpiDeportivaConnectionString %>"
        SelectCommand="SELECT IdClasificacion, Descripcion FROM Clasificacion WHERE IdGenero=@IdGenero">
        <SelectParameters>
            <asp:ControlParameter  ControlID="IdGenero" Type="int32" Name="IdGenero"/>
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="IdClasificacionDB" runat="server" ConnectionString="<%$ ConnectionStrings:OpiDeportivaConnectionString %>"
        SelectCommand="SELECT [IdClasificacion], [Descripcion] FROM [Clasificacion]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="NotasDb" runat="server" ConnectionString="<%$ ConnectionStrings:OpiDeportivaConnectionString %>"
        SelectCommand="SELECT CveNota, Titulo, SUBSTRING(Comentario,1,130)+'...' AS Coment, S.Descripcion AS Estado, G.Descripcion AS Genero, C.Descripcion as Clasificacion, N.Volanta, N.Comentario, N.Nota, N.IdGenero, N.IdClasificacion FROM Notes N INNER JOIN States S ON N.CveEstado=S.CveEstado INNER JOIN Genero G ON N.IdGenero=G.IdGenero INNER JOIN Clasificacion C ON N.IdClasificacion=C.IdClasificacion AND N.IdGenero=C.IdGenero WHERE FecAlta BETWEEN @Desde AND @Hasta AND N.CveUsuario = @CveUsuario AND N.CveEstado = @CveEstado ORDER BY CveNota DESC"
        InsertCommand="INSERT INTO [Notes]([Volanta],[Titulo], [Comentario], [Nota], [CveUsuario], [IdGenero], [IdClasificacion]) VALUES (@Volanta, @Titulo, @Comentario, @Nota, @CveUsuario, @IdGenero, @IdClasificacion)"
        UpdateCommand="UPDATE [Notes] SET [Volanta]=@Volanta, [Titulo]=@Titulo, [Comentario]=@Comentario, [Nota]=@Nota, [IdGenero]=@IdGenero, [IdClasificacion]=@IdClasificacion WHERE [CveNota]=@CveNota">
        <SelectParameters>
            <asp:ControlParameter ControlID="Desde"      Type="DateTime" Name="Desde"      PropertyName="SelectedDate" />
            <asp:ControlParameter ControlID="Hasta"      Type="DateTime" Name="Hasta"      PropertyName="SelectedDate" />
            <asp:ControlParameter ControlID="CveUsuario" Type="String"   Name="CveUsuario" DefaultValue="2" />
            <asp:ControlParameter ControlID="CveEstado"  Type="String"   Name="CveEstado"  DefaultValue="1" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="IdClasificacion" Type="Int16" />
        </UpdateParameters>
        <InsertParameters>
            <asp:SessionParameter Name="CveUsuario" SessionField="CveUsuario" Type="Int16" />
            <asp:Parameter Name="IdClasificacion" Type="Int16" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>


As I get selected value in DropDownList SelectIndexChanged event.
greetings



Gonzalo
Top achievements
Rank 1
 answered on 02 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?