Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
495 views
How to set MinDate for all RadDatePicker controls in project? In one place
Mike
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
129 views
I'm using 2012 Q1.  On a very simple page I have a RadGrid and RadCalendar.  The RadGrid displays invoices for a certain day, and I have an ObjectDataSource with a ControlParameter using RadCalendar.SelectedDate as the SQL parameter.  On page load, I set the SelectedDate as today to set it for the first time.

When I click around on dates, I'm often getting the error "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." I changed the code to add a RadButton, and call RadGrid.Rebind() on the click.  I also manually set the value of the parameter in the Selecting event.  What I noticed was the SelectedDate value was "#12:00:00 AM#", even though I clicked a date, and then clicked the RadButton.

Clicking through the dates, if the RadGrid is empty due to no records, I'm able to keep navigating through.  However, if I load records from a date, the very next RadGrid.Rebind() is what triggers this error.

Is there something I'm missing?
eric
Top achievements
Rank 1
 answered on 28 Mar 2012
2 answers
295 views

I am replacing a standard listbox control with a RADLISTBOX control and thought it would be pretty seamless to switch out, but I am not having any luck with populating the RADLISTBOX. Can someone please tell me what I am doing wrong? I am not doing anything spectacular, just a simple databind with datareader.

Here is my code aspx.vb

Dim item As New RadListBoxItem()
           
        While reader4.Read
            item.Value = reader4("DescriptionLong")
            ConditionList.Items.Add(item)

Here is my aspx. code

<telerik:RadListBox ID="ConditionList" Width="160px" runat="server"
   Skin="Office2010Blue">
                     
</telerik:RadListBox>
Charles
Top achievements
Rank 1
 answered on 28 Mar 2012
2 answers
154 views
Hi,

i am trying to apply differetn skinIds to all my sub grid to tell them apart but it seems as if it does not work, I have the skins set but when I open the grid the sub grid come up as white with black letters.  Before I set the cssStyles on them but I want alike color schemas on them and this is hard to sit around and try to come up with a color schema that matches the web20 color schema.  So the question is how can I set the sub heiarchal grids skinId and make it work.  Thanks
<telerik:RadGrid ID="myRadGrid" runat="server" Width="100%" BorderWidth="1px" CellPadding="4" Skin="Web20">
                                    <MasterTableView AutoGenerateColumns="false" DataKeyNames="intCategoryId" HierarchyDefaultExpanded="false" Font-Size="10" Font-Names="Veranda,arial,sans-serif" 
                                        HeaderStyle-HorizontalAlign="Center" Name="MasterGrid" ExpandCollapseColumn-ButtonType="ImageButton" HierarchyLoadMode="Client" AllowPaging="True" PageSize="20" 
                                        PagerStyle-Mode="NumericPages" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                        <ItemStyle HorizontalAlign="Center" /><AlternatingItemStyle BackColor="#B0C4DE"  HorizontalAlign="Center" /><HeaderStyle ForeColor="White" Font-Bold="true"  />
                                        <DetailTables>
                                            <telerik:GridTableView Name="myManufacGrid" runat="server" DataKeyNames="intManufacturerId" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10" SkinID="web20"
                                                AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                                ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="intCategoryId" MasterKeyField="intCategoryId" />
                                                </ParentTableRelation>
                                                <HeaderStyle Font-Bold="true" HorizontalAlign="Center" /><ItemStyle HorizontalAlign="Center" /><AlternatingItemStyle  HorizontalAlign="Center" />
                                                <DetailTables>
                                                <telerik:GridTableView DataKeyNames="intMakeId" Name="myMakeGrid" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10" SkinID="web20"
                                                    AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                                    ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                        <ParentTableRelation>
Kevin
Top achievements
Rank 1
 answered on 28 Mar 2012
5 answers
298 views
I add an image to my hyperlink column from the code behind. Unfortunately it adds the image even if no value for the field is in the database. I would like to hide the image if the value is NULL or empty.

Here is my ASPX column code:

<telerik:GridHyperLinkColumn DataNavigateUrlFields="Email" HeaderText=" "
     DataNavigateUrlFormatString="mailto:{0}"
     UniqueName="Email" AllowFiltering="False" ItemStyle-HorizontalAlign="Center">
 <ItemStyle Width="50px"/>
</telerik:GridHyperLinkColumn>


I have tried:
Private Sub RadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid2.ItemDataBound
    If (TypeOf e.Item Is GridDataItem) Then
 
        Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
        Dim hyperlink As HyperLink = CType(dataItem("Email").Controls(0), HyperLink)
        hyperlink.ImageUrl = "../../../images/iconoutlook.gif"
 
        If (dataItem.OwnerTableView.DataKeyValues(dataItem.ItemIndex)("Email") Is System.DBNull.Value) Then
            Dim ltrl As LiteralControl = New LiteralControl(hyperlink.Text)
            dataItem("Email").Controls.Clear()
            dataItem("Email").Controls.Add(ltrl)
        End If
 
    End If
End Sub


Any help appreciated.
Allan
Top achievements
Rank 2
 answered on 28 Mar 2012
2 answers
142 views
Hi everybody!!!

i have a problem using radpagemultiview i have on each radpageview a grid, my problem is in the second radgrid when i use  javascript openRadWindow if i do double click the popup get the correct  path but if i click in the link button using javascript not get the correct path i dont understand why because i wrote correct path

<a href="#" onclick="openRadWindow2('<%#DataBinder.Eval(Container.DataItem,"cod_empleado")%>'); return false;">
                            Imprimir</a>

and my javascript:

<telerik:RadCodeBlock ID="RadCodeBlock4" runat="server">
            <script type="text/javascript">

                function refreshGrid(arg) {
                    if (!arg) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
                    else {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                    }
                }
                function RowDblClick(sender, eventArgs) {
                    window.radopen("Descuentoempleado?cod_empleado=" + eventArgs.getDataKeyValue("cod_empleado"), "UserListDialog");

                }
                function openRadWindow(cod_empleado_) {
                    var oWnd = radopen("Descuentoempleado.aspx?cod_empleado=" + cod_empleado_, "UserListDialog");
                    oWnd.center();
                }
                
            </script>
        </telerik:RadCodeBlock>
i hope anybody can help me thank u very much
Robert
Top achievements
Rank 2
 answered on 28 Mar 2012
5 answers
157 views
Hi Telerik,

I'm having an issue with the RadGrid control.

After resizing my browserwindow my radgrid is being resized.
It changes my height with a few pixels.

I tried debugging the javascript and in the setDataDivHeight function it decides to  remove 17 pixels because Telerik.Web.UI.Grid.getScrollBarHeight() returns 17. But I didn't have a scrollbar!

Currently i'm using Telerik controls version: 2011.2.915.35.

Is there a workaround for this?
Tsvetina
Telerik team
 answered on 28 Mar 2012
1 answer
115 views
Is it possible to change this from the dashed default?  I assume it is just a style, but I cannot locate it.

Thanks,

Steve
Steve
Top achievements
Rank 1
 answered on 28 Mar 2012
2 answers
162 views
Hello,

I currently have RadGrids that I am creating dynamically in Page Load that are embedded in PanelBar Items.  The grids create fine and render on the page.  They have the initial appearance of drag and drop, but when the row is released into the new grid, the routine tied to the RowDrop event (GridRowDrop) does not fire and the Page appears to do a PostBack.  I believe this has to do with something with AJAX settings, but not certain.

Here is a snippet from the code-behind:

Dim SectionGrid As New RadGrid()
 
 With SectionGrid
     .DataSource = GetData(FCTN_TYPE_CD, CALLING_AGENT)
     With .MasterTableView
         .NoMasterRecordsText = "No associates assigned"
         .Columns.Add(New GridDragDropColumn)
     End With
     .Rebind()
 End With
 
 ' Set each grid's properties.
 With SectionGrid
     .ID = "SectionGrid_" & FCTN_TYPE_CD
     .AllowSorting = True
     .Width = Unit.Percentage(99)
     .AutoGenerateColumns = False
     .ShowHeader = False
     .AllowMultiRowSelection = True
     .CssClass = "BottomCorners"
     .Attributes.Add("style", "border:none;")
     With .ClientSettings
         .AllowRowsDragDrop = True
         .Selecting.EnableDragToSelectRows = False
         .Selecting.AllowRowSelect = True
         .ClientEvents.OnRowDropping = "onRowDropping"
         .EnablePostBackOnRowClick = False
     End With
 End With
 
 With SectionGrid.MasterTableView
     .Width = Unit.Percentage(100)
     .DataKeyNames = New String() {"LDAP"}
     .GetColumn("LDAP").Visible = False
 End With
 
 AssignedGrid.Controls.Add(SectionGrid)
 With PanelItem
     .Items.Add(AssignedGrid)
     .Expanded = True
 End With
 
 If SectionGrid.Items.Count = 0 Then PanelItem.Expanded = False
 
 AddHandler SectionGrid.RowDrop, AddressOf GridRowDrop
 AddHandler SectionGrid.NeedDataSource, AddressOf GridNeedDataSource

Any help is appreciated.

regards,

Steve
Steve
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
110 views
Hi there,

Am using RadTagCloud.
I have user control on this page with RadTagCloud,  this user control using in my aspx page.
but ItemClick event is giving problem like Object reference not found.

Below find my code snnipet
code behind if UserControl 
public partial class ucCustomerSelector : System.Web.UI.UserControl
  {
    public EventHandler rtcLinksClicks;


    protected void Page_Load(object sender, EventArgs e)
    {
    }


    protected void rtcLinks_ItemClick(object sender, Telerik.Web.UI.RadTagCloudEventArgs e)
    {
      rtcLinksClicks(sender, e);
    }


  }
******************************************
code behind of aspx page
public partial class CustomerPage : System.Web.UI.Page
  {
    


    protected void Page_Load(object sender, EventArgs e)
    {
      
      if (!Page.IsPostBack)
      {
        
        ucCustomerSelector.rtcLinksClicks += new EventHandler(myclick);
      }
    }


    private void myclick(object sender, EventArgs e)
    {
      // my logic wil come here.
    
    }
}
please give me solution, I am waiting for reply.
thanks in advance.
Slav
Telerik team
 answered on 28 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?