Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
41 views
Hi I'm new using telerik rad controls an asp development and I need some help. I have a radGrid wich is populated with data when a button is pressed, I found a solution here in the forum for selecting a row of the radGrid and taking the values of each cell, but now I want to know how to save this values into my database using entity framework. What I've been trying is to put the values into strings and then in my saving method call the strings, but when I execute the program I add two breakpoints, one in the method that selects the row and take the values and other in the saving method, whe see the results of the breakpoints in the first method which takes the value of the selected row each string contains the data corresponding to the cell in the radGrid, but in my saving method the strings appears empty, How can I solve this problem?
Hope you could help me.
Here's my two methods for selecting
protected void RgSolic_SelectedIndexChanged(object sender, EventArgs e)
       {
           foreach (GridDataItem selectedItem in rgSolic.SelectedItems)
           {
               strNom = selectedItem["NombreCompleto"].Text;
               strPuesto = selectedItem["nom_pue"].Text;
               strCveAdscripcion = selectedItem["cve_adscripcion"].Text;
               strArea = selectedItem["nom_area"].Text;
                
           
       }
       protected void btnRegistra_Click(object sender, EventArgs e)
       {
           //BD_SSEGUAEntities sseguaRegistro = new BD_SSEGUAEntities();
           //sseguaRegistro.spRegistraSolicitud1();
           //Valida Datos del Menor
           using (var dbContext = new BD_SSEGUAEntities())
           {
               var ResultSet = new Menor();
               var ResultSol = new Solicitud();
               var ResulBitacora = new Bitacora();
               if (chkMasc.Checked)
               {
                   sexo = "M";
               }
               if (chkFem.Checked)
               {
                   sexo = "F";
               }
               if (rdTxtAPatMen.Text != "" && rdTxtAMatMen.Text != "" && rdTxtNomMen.Text != "" && RadDatePicker1.SelectedDate != null && sexo != "" && rdCmbEdificio.SelectedValue != "" && rdTxtDomicilio.Text != "" && rdTxtHEnt.Text != "" && rdTxtHSal.Text != "" && rdTxtTelOfic.Text != "" && rdTxtExt.Text != "" && rdTxtPart.Text != "" && rdTxtCorreoE.Text != "" && rdTxtDomPart.Text != "" && rdTxtNHijos.Text != "" && rdCmbTEmbzo.SelectedValue != "0")
               {
                   try
                   {
                         
                       System.DateTime.Now.Year.ToString();
                       //ResultSol.fcCvePuesto = rgSolic.Columns.FindByUniqueName("nom_pue").ToString();
                       //ResultSol.fcCveAdsc = rgSolic.Columns.FindByDataField("cve_adscripcion").ToString();
                       ResultSol.fcNomEmpleado = strNom;

                                ResultSol.fcCveAdsc = strCveAdscripcion;

                       ResultSol.fcCvePuesto = strPuesto;
                       ResultSol.fcDomLabora = rdTxtDomicilio.Text;
                       ResultSol.fiHorEntLab = (Byte)rdTxtHEnt.Value;
                       ResultSol.fiHorSalLab = (Byte)rdTxtHSal.Value;
                       ResultSol.fiTelOfna = rdTxtTelOfic.Text;
                       ResultSol.fiExtTel = rdTxtExt.Text;
                       ResultSol.fiTelPart = rdTxtPart.Text;
                       ResultSol.fcCorreoE = rdTxtCorreoE.Text;
                       ResultSol.fcDomPart = rdTxtDomPart.Text;
                       ResultSol.fiNumHijos = (Byte)rdTxtNHijos.Value;
                         
                       foreach (var menor in listaMenores)
                       {
                           ResultSol.Menor.Add(menor);
                       }
                       dbContext.AddToSolicitud(ResultSol);
                       dbContext.SaveChanges();
                       //ResultSet.fcPatMenor = rdTxtAPatMen.Text;
                       //ResultSet.fcMatMenor = rdTxtAMatMen.Text;
                       //ResultSet.fcNomMenor = rdTxtNomMen.Text;
                       //ResultSet.fdFchNacMenor = (DateTime)RadDatePicker1.SelectedDate;
                       //ResultSet.fiAnosMenor = (Byte)rdTxtAnio.Value;
                       //ResultSet.fiMesesMenor = (Byte)rdTxtMeses.Value;
                       //ResultSet.fiSexoMenor = sexo;
                       //ResultSet.fdFchRegMenor = DateTime.Today;
                       //dbContext.Menores.AddObject(ResultSet);
                       //dbContext.SaveChanges();
                       //RgMenor.DataSource = ResultSet;
                       //RgMenor.Rebind();
                   }
                   catch (Exception ex)
                   {
                       Alerta(ex.Message);
                   }
               }
               else
               {
                   Alerta("Captura todos lo datos del Menor");
               }
           }
       }
Cristian
Top achievements
Rank 1
 asked on 27 May 2011
1 answer
141 views
If I take StoredProcedure as SqlDataSource for Combobox "RadCombobox2", I can not select a value(see Att.1). If I configure sqldatasource3(see Att.2) when I put manuelly the field entry, I get errors:

The DataSourceID of 'cbDays' must be the ID of a control of type IDataSource.  A control with ID 'SqlDataSource3' could not be found.

If I take instead of StoredProcedure  a Select.. define - no problem.

       <div class="class_1" style="width:512px">
           <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0"
               DataSourceID="SqlDataSource1" GridLines="None">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="DokId"
                   DataSourceID="SqlDataSource1">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridTemplateColumn DataField="DokuType"
            FilterControlAltText="Filter column column" HeaderText="Materials"
            UniqueName="DokuType">
            <EditItemTemplate>
                <telerik:RadComboBox runat="server">
                </telerik:RadComboBox>
            </EditItemTemplate>
            <ItemTemplate>
                <telerik:RadComboBox ID="RadComboBox1" Runat="server">
                    <Items>
                        <telerik:RadComboBoxItem runat="server" Text="Documentation"
                            Value="Tagungsunterlagen" />
                        <telerik:RadComboBoxItem runat="server" Text="Books" Value="Bücher" />
                        <telerik:RadComboBoxItem runat="server" Text="Other" Value="Sonstiges" />
                    </Items>
                </telerik:RadComboBox>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="VAday"
            FilterControlAltText="Filter column1 column" HeaderText="Days"
            UniqueName="VAday">
            <EditItemTemplate>
                <telerik:RadComboBox runat="server">
                </telerik:RadComboBox>
            </EditItemTemplate>
            <ItemTemplate>
                <telerik:RadComboBox ID="RadComboBox2" Runat="server"
                    DataSourceID="SqlDataSource3" SelectedValue='<%# Bind("VAday") %>'>
                </telerik:RadComboBox>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn FilterControlAltText="Filter Delegates column"
            HeaderText="Delegates" UniqueName="Delegates">
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="Menge" DataType="System.Int16"
            FilterControlAltText="Filter Menge column" HeaderText="Additional Amount"
            UniqueName="Menge">
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn DataField="Price"
            FilterControlAltText="Filter DokuType column" HeaderText="Unit Price"
            UniqueName="Price">
            <EditItemTemplate>
                <asp:TextBox ID="DokuTypeTextBox" runat="server" Text='<%# Bind("DokuType") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="DokuTypeLabel" runat="server" Text='<%# Eval("DokuType") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
           </telerik:RadGrid>
           <asp:SqlDataSource ID="SqlDataSource1" runat="server"
               ConnectionString="<%$ ConnectionStrings:webzeus %>"
               SelectCommand="SELECT * FROM [Dokus] WHERE ([Number] = @Number)">
               <SelectParameters>
                   <asp:SessionParameter  Name="Number" SessionField="curNumber"
                       Type="Int32" />
               </SelectParameters>
           </asp:SqlDataSource>
           <asp:SqlDataSource ID="SqlDataSource3" runat="server"
               ConnectionString="<%$ ConnectionStrings:webzeus %>"
               SelectCommand="pr_TNproTag" SelectCommandType="StoredProcedure">
               <SelectParameters>
                   <asp:SessionParameter DefaultValue="12814" Name="curNumber"
                       SessionField="curNumber" Type="Int32" />
                   <asp:Parameter DefaultValue="Dokus" Name="curPar" Type="String" />
               </SelectParameters>
           </asp:SqlDataSource>
       </div>
 
</div>



Cat Cheshire
Top achievements
Rank 1
 answered on 27 May 2011
14 answers
246 views
Hi Telerik Team
I´m using Radwindow and when IE did their last update to version 9 the Radwindow fails to open. I have not written the code so I don´t know why it fails. The page works like a charm in IE7,8 and firefox.

Here is example code.

 

<telerik:RadWindow ID="RadWindow1" VisibleOnPageLoad="false" Title="Visa tid" IconUrl="~/App_Themes/Classic/Images/MenuItems/book.png"

 

 

runat="server" Modal="false" Top="0px" Left="0px" VisibleStatusbar="false" VisibleTitlebar="true"

 

 

AutoSize="false" Width="640px" Height="340px" ShowContentDuringLoad="false" OnClientBeforeClose="window_beforeClose"

 

 

Behavior="Close" Style="z-index: 10000">

 

 

</telerik:RadWindow>

 

 

 

var currentBookingId = 0;

 

 

 

 

function openSlot(slotId, bookingId) {

 

 

 

 

if (cancelPopup) { cancelPopup = false;return; }

 

 

 

 

if (currentBookingId > 0) $("#b" + currentBookingId).removeClass("selected");

 

 

currentBookingId = bookingId;

 

$(

 

"#b" + currentBookingId).addClass("selected");

 

 

 

 

var url = "EditSlot.aspx?standalone=true&Id=" + slotId;

 

 

 

 

var oWnd = $find("<%=RadWindow1.ClientID%>");

 

 

oWnd.set_title(

 

"Laddar...");

 

 

oWnd.setUrl(url);

 

oWnd.show();

 

}

Mvh
/Emil Eriksson

Emil Eriksson
Top achievements
Rank 1
 answered on 27 May 2011
3 answers
871 views
Hi
I have following code for a GridBoundColumn (Zip Code) 
<telerik:GridBoundColumn HeaderText="Zip Code" UniqueName="ZipCode" DataField="ZipCode"
     ItemStyle-Wrap="true" AllowSorting="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Left"
                   HeaderStyle-Width="9%"  ItemStyle-HorizontalAlign="Left" ItemStyle-Width="9%" DataFormatString="{0:#####-####}">                                                                                               
                           </telerik:GridBoundColumn>

but the DataFormatString property doesn't work properly........
let me know any solution..
Thanks in advance..
Vasil
Telerik team
 answered on 27 May 2011
2 answers
79 views
Performance of our RadScheduler has been getting progressively worst as the number of records grow. We are using the suggestions mentioned around filtering the appointments for just the view being displayed.

The problem is that over the past 2 years a substantial number of recurring entries have been added, most of which have expired and are no longer valid. As we have little requirement for reviewing past appointments it would be beneficial to remove these entries.

Has anyone figured out a good way to archive off this data or remove it entirely? Some routine that calculates out each recurrence rule to see if it's still valid?

Any suggestions would be appreciated.

Thanks
Clyde
Clyde
Top achievements
Rank 1
 answered on 27 May 2011
2 answers
348 views
Hello,

I am using telerisk scheduler with the code below:

<

 

telerik:RadScheduler ID="rsDaySchedule" Height="2093px" BorderStyle="None" ShowNavigationPane="false" Width ="100%" ShowViewTabs="false" AllowDelete="False" AllowEdit="true" AllowInsert="False" HoursPanelTimeFormat="h:mmtt" NumberOfHoveredRows="1" RowHeight ="52px" DayStartTime="8:30:00" DayEndTime="13:00:00" SelectedView="DayView" OnAppointmentDataBound="rsDaySchedule_AppointmentDataBound" OnAppointmentCommand="rsDaySchedule_AppointmentCommand" OnAppointmentClick="rsDaySchedule_AppointmentClick" MinutesPerRow="15" DataSubjectField="OrgName" DataKeyField="ScheduleEntryID" DataStartField="startTime" DataEndField="endTime" CustomAttributeNames="Desicions,DayLeft,ScheduleEntryID,OrgID" EnableCustomAttributeEditing="true" runat="server" style="left: 0px; top:0px" Skin

="Sunset">  

 

<AppointmentTemplate > 

 

<asp:Table ID="Table1" CssClass="OrgInfo" BorderStyle="NotSet" runat="server" Width ="100%" Height="52px" >

 

 

<asp:TableRow Height="30px">

 

<asp:TableCell Width ="109px">

<asp:Label ID="lblOrgName" runat ="server" Text="Organization Name: "></asp:Label>

 

</asp:TableCell>

 

 

<asp:TableCell Width ="339px">

 

 

<asp:Label ID="txtOrgName" runat ="server" Font-Bold="true" Text='<%# Eval("Subject") %>'></asp:Label> 

 

 

 

 

 

</asp:TableCell>
<asp:TableCell Width ="228px">

 

<asp:Label ID="lblDecision" runat ="server" Text="Decision: "></asp:Label>

<asp:Label ID="txtDecision" runat ="server" Font-Bold="true" Text='<%# Eval("Desicions") %>'></asp:Label>

&nbsp;&nbsp;

 

</asp:TableCell>
<asp:TableCell Width="82px">
<asp:Label ID="lblDayLeft" runat ="server" Text="Days Left: "></asp:Label>&nbsp;&nbsp;

 

 

<asp:Label ID="txtDayLeft" runat ="server" Font-Bold="true" Text='<%# Eval("DayLeft") %>'></asp:Label>

 

<asp:HiddenField ID="hdScheduleEntryID" Value ='<%# Eval("ScheduleEntryID") %>' runat="server" />

 

 

<asp:HiddenField ID="hdOrgID" Value ='<%# Eval("OrgID") %>' runat="server"/>

 

 

</asp:TableCell>

 

 

</asp:TableRow>

 

 

<asp:TableRow Height="21px">

 

<asp:TableCell >

</asp:TableCell>
<asp:TableCell>
</asp:TableCell>
<asp:TableCell >
<sp:LinkButton ID="lbtnResche" runat="server" ForeColor="Blue" CommandName="Reschedule" Text="Reschedule"></asp:LinkButton>&nbsp;&nbsp;
<asp:LinkButton ID="lbtnRatings" runat="server" ForeColor="Blue" CommandName="EditRating" Enabled="True" Text="Edit Ratings"></asp:LinkButton &nbsp;&nbsp; <asp:LinkButton ID="lbtnNext" runat="server" ForeColor="Blue" CommandName="More" Text="More info ..." > </asp:LinkButton>
</asp:TableCell>
</asp:TableRow>

 

 

</asp:Table>
</AppointmentTemplate>

 

 

</telerik:RadScheduler>

My requestion is "How to find the controls in my AppointmentTemplate from AppointmentDataBound?"

How come in my

 

 

 

Protected Su

 

b rsDaySchedule_AppointmentDataBound(ByVal sender As Object, ByVal e As

SchedulerEventArgs)

 

 

 

 

 

 

Dim lbtnRatings As LinkButton = CType(e.Appointment.AppointmentControls(0).FindControl("lbtnRatings"), LinkButton)

I get error message -- Index was out of range.

 &

e.Appointment.AppointmentControls.count =0  always !

 

 

 

Please help ! Thanks a lot!

 

Susan Sun
Top achievements
Rank 1
 answered on 27 May 2011
2 answers
79 views
<telerik:RadScheduler ID="rsDaySchedule" Height="2093px"   BorderStyle="None" ShowNavigationPane="false"  Width ="100%" ShowViewTabs="false" AllowDelete="False"  AllowEdit="true" AllowInsert="False" HoursPanelTimeFormat="h:mmtt" NumberOfHoveredRows="1"   
         RowHeight ="52px"   DayStartTime="8:30:00" DayEndTime="13:00:00" SelectedView="DayView" OnAppointmentDataBound="rsDaySchedule_AppointmentDataBound"   OnAppointmentCommand="rsDaySchedule_AppointmentCommand"  OnAppointmentClick="rsDaySchedule_AppointmentClick"   MinutesPerRow="15" DataSubjectField="OrgName" DataKeyField="ScheduleEntryID" DataStartField="startTime" DataEndField="endTime"  CustomAttributeNames="Desicions,DayLeft,ScheduleEntryID,OrgID" EnableCustomAttributeEditing="true"  runat="server" style="left: 0px; top:0px" Skin="Sunset">
       
<AppointmentTemplate >                  
         
<asp:Table ID="Table1" CssClass="OrgInfo" BorderStyle="NotSet"  runat="server" Width ="100%" Height="52px" >
 <asp:TableRow Height="30px">
 <asp:TableCell Width ="109px">
<asp:Label ID="lblOrgName" runat ="server" Text="Organization Name: "></asp:Label>
</asp:TableCell>
<asp:TableCell Width ="339px">
 <asp:Label ID="txtOrgName" runat ="server" Font-Bold="true" Text='<%# Eval("Subject") %>'></asp:Label
</asp:TableCell>
<asp:TableCell Width ="228px">
<asp:Label ID="lblDecision" runat ="server" Text="Decision: "></asp:Label>
                  
 <asp:Label ID="txtDecision" runat ="server" Font-Bold="true" Text='<%# Eval("Desicions") %>'></asp:Label>   
 </asp:TableCell>
<asp:TableCell Width ="82px">
 <asp:Label ID="lblDayLeft" runat ="server" Text="Days Left: "></asp:Label>   
                  
<asp:Label ID="txtDayLeft" runat ="server" Font-Bold="true" Text='<%# Eval("DayLeft") %>'></asp:Label>  
<asp:HiddenField ID="hdScheduleEntryID" Value ='<%# Eval("ScheduleEntryID") %>' runat="server" />
<asp:HiddenField ID="hdOrgID" Value ='<%# Eval("OrgID") %>' runat="server" />
</asp:TableCell>
</asp:TableRow>
               
<asp:TableRow Height="21px">
 <asp:TableCell >
</asp:TableCell>
<asp:TableCell >
</asp:TableCell>
 <asp:TableCell >
 <asp:LinkButton ID="lbtnResche" runat="server" ForeColor="Blue"  CommandName="Reschedule"  Text="Reschedule"></asp:LinkButton>
                    
 <asp:LinkButton ID="lbtnRatings" runat="server" ForeColor="Blue"  CommandName="EditRating" Enabled="True" Text="Edit Ratings"></asp:LinkButton>
                    
 <asp:LinkButton ID="lbtnNext" runat="server" ForeColor="Blue" CommandName="More"  Text="More info ..." > </asp:LinkButton>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
             
</AppointmentTemplate>
         
            
</telerik:RadScheduler>

My question: How to find my control lbtnRatings form

 

Protected Sub rsDaySchedule_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)

Thank you very much for your help in advance!

Susan

 

Susan Sun
Top achievements
Rank 1
 answered on 27 May 2011
2 answers
70 views
Hi All, not sure if this is the right place to post this question so if it isn't I apologise...

I want to use the built in Black skin for my ASP.Net AJAX controls on a website I'm building, but instead of the highlight colour when hovering etc to be the lime green, I want to use orange. I know the colour (#9eda29) and could do a global replace on the skins to #ff6600 but I was wondering if there was a better way?

I'd rather not have to add all the skin css references to my pages but if this is what I need to do then so be it, but I thought I'd ask.

Karl
Top achievements
Rank 1
 answered on 27 May 2011
6 answers
311 views
in RadNumericTextBox how to use AutoCompleteType="Disabled"


Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 27 May 2011
8 answers
138 views
Hi,
I have a tooltip that works just great (pops up on top of the checkbox) until you scroll down far enough to where the tooltip has to be displayed under the content.  This is where it gets interesting:
1) When 1st hover over content the tooltip shows up in the correct place (under the checkbox).  Then if you scroll up and hover on content again the tooltip is on the right side, almost like it has position:TopRight applied.
2) When hover over content again the tooltip shows up under the content but is also on the right side, like it has position:BottomRight applied.  (When scroll up and hover on content, the tooltip is in it's proper position)
How can I fix this problem?  Thanks so much!

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wishListToolTip.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<!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>Wish List ToolTips</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"  RelativeTo="Element" Position="TopLeft" Width="250" Height="50" AutoTooltipify="True" OffsetY="12" OffsetX="-400">
</telerik:RadToolTipManager><br>    <br /><br /><br /><br /><br><br><br>   
<
asp:CheckBox ID="CheckBox7" runat="server" text="This is my placeholder text" ToolTip="This is my placesholder tooltip text" /><br /><br /><br>      <br /><br /><br /><br /><br /><br /><br /><br /><br>   
</
form>
</body>
</html>
Megan
Top achievements
Rank 1
 answered on 27 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?