Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
481 views

Hi,
i am D.Srinivasa,

                       in my project i have a RadGrid to Display a Data from the DataBase, in my RadGrid i have a RadDatePicker Control to display a date from backend,  here enabled the maximum date condition in Raddatepicker,

the following coding is the condition for maximum date operation in RadDatePicker, it checks whether the database can have the data or not, if data is available then it sets the maximum date to that RadDatePicker,

it returns an error is Specified Cast in Not Valid..

Code Is : 

<telerik:GridTemplateColumn UniqueName="gridActStart" HeaderText="Actual Start" AllowFiltering="false" ItemStyle-HorizontalAlign="Center"><br>
 <
ItemTemplate><br>                     
 <
telerik:RadDatePicker ID="actstart" runat="server" MaxDate='<%#If((Eval("early_start_display") IsNot DBNull.Value), Convert.ToDateTime(Eval("early_start_display")), CType("10/10/2011", System.Nullable(Of DateTime))) %>' Width="100px" Calendar-ShowOtherMonthsDays="false" Calendar-ShowRowHeaders="false" DbSelectedDate='<%# Bind("actual_start") %>' DateInput-DateFormat="MM/dd/yyyy">                     
</
telerik:RadDatePicker><br>                       
</
ItemTemplate><br>                   
 </
telerik:GridTemplateColumn>

and the following attachment is the database for my application. How to resolve this problem,

Thank You,
D.Srinivasa
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Aug 2011
11 answers
165 views
I have a VERY simple RibbonBar on an othewise blank test page that is throwing a JavaScript error: "object does not support this property or method" in the dynamically generated Telerik WebResource file. Here is the source code of the page. The only code behind is the button click handler which has no code in it. What am I calling out on the Ribbon that is not supported?? See the attached screenshot for the debugger capture.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="foo.aspx.vb" Inherits="testing_foo" %>
 
<%@ Register Src="../HR/controls/Credentials.ascx" TagName="Credentials" TagPrefix="uc1" %>
<%@ Register src="../protected/payroll/controls/AuthorizationsEdit.ascx" tagname="AuthorizationsEdit" tagprefix="uc2" %>
<%@ Register src="../controls/Authorizations.ascx" tagname="Authorizations" tagprefix="uc3" %>
<%@ Register src="../controls/CaseNotes.ascx" tagname="CaseNotes" tagprefix="uc4" %>
<%@ Register src="../controls/searchers/CustomerSearcher.ascx" tagname="CustomerSearcher" tagprefix="uc5" %>
<%@ Register src="../controls/pickers/Customer_Picker.ascx" tagname="Customer_Picker" tagprefix="uc6" %>
<!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>
 
</head>
<body>
    <form id="form1" runat="server">
   
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
   
    <telerik:RadRibbonBar ID="radMainRibbon" runat="server" SelectedTabIndex="0">
        <telerik:RibbonBarTab Text="Home">
            <telerik:RibbonBarGroup Text="General">
                <Items>
                    <telerik:RibbonBarButton ID="btnHomeHome" runat="server" Size="Large" Text="&nbsp;Home&nbsp;" Value="~/Default.aspx" ImageUrlLarge="~/images/home-m.gif" />
                </Items>
            </telerik:RibbonBarGroup>
        </telerik:RibbonBarTab>
    </telerik:RadRibbonBar>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    </form>
</body>
</html>

Kate
Telerik team
 answered on 24 Aug 2011
3 answers
287 views
Hi All

I have a grid that is using static headers with columns declaring widths using the header.width property. However I have no control over the grid size by resizing my columns,  as resizing one column stretches out the other so the grid fits the whole page, like it is auto resizing to fit the page. Any Ideas on how to have control of grid widths greatly appreciated.

<telerik:RadGrid ID="gvDefleetCapIds" runat="server" AllowSorting="True" 
                  AutoGenerateColumns="False" CellSpacing="0" Font-Names="Verdana" 
                  Font-Size="X-Small" GridLines="None" 
                  ondetailtabledatabind="gvDefleetCapIds_DetailTableDataBind" 
                  oneditcommand="gvDefleetCapIds_EditCommand" 
                  onitemcommand="gvDefleetCapIds_ItemCommand" 
                    
                  onupdatecommand="gvDefleetCapIds_UpdateCommand" Width="1246px" 
                  AllowPaging="True" PageSize="30" AllowCustomPaging="True" Skin="WebBlue" 
                  onneeddatasource="gvDefleetCapIds_NeedDataSource" 
                  onitemdatabound="gvDefleetCapIds_ItemDataBound">
                  <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default" >
                  </headercontextmenu>
                  <mastertableview autogeneratecolumns="False" cellspacing="0" 
                      datakeynames="CapID,Year,Plate" font-names="Verdana" font-size="X-Small">
                                              <CommandItemSettings ExportToPdfText="Export to PDF" />
                      <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                      </RowIndicatorColumn>
                      <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                          Visible="True">
                      </ExpandCollapseColumn>
                      <Columns>
                        
                          <telerik:GridBoundColumn DataField="CapID" HeaderStyle-Width="25px"
                              FilterControlAltText="Filter column2 column" HeaderText="CapID" 
                              UniqueName="column2">
                          </telerik:GridBoundColumn>
                            
                          <telerik:GridBoundColumn DataField="V_Description"
                              FilterControlAltText="Filter column1 column" HeaderText="V_Description" 
                              UniqueName="column1">
                          </telerik:GridBoundColumn>
                            
                          <telerik:GridBoundColumn DataField="Plate" HeaderStyle-Width="10px"
                              FilterControlAltText="Filter column column" HeaderText="Plate" 
                              UniqueName="column">
                          </telerik:GridBoundColumn>
                            
                           <telerik:GridBoundColumn DataField="Year" 
                              FilterControlAltText="Filter column4 column" HeaderText="Year" HeaderStyle-Width="20px"
                              UniqueName="column4">
                          </telerik:GridBoundColumn>
                            
                          <telerik:GridBoundColumn DataField="Units" HeaderStyle-Width="10px"
                              FilterControlAltText="Filter column6 column" HeaderText="Units" 
                              UniqueName="column6">
                          </telerik:GridBoundColumn>
                            
                          <telerik:GridBoundColumn DataField="Price" HeaderStyle-Width="25px"
                              FilterControlAltText="Filter column3 column" HeaderText="CAP_Price" 
                              UniqueName="column3">
                          </telerik:GridBoundColumn>                         
                           
                          <telerik:GridBoundColumn Aggregate="Sum" DataField="AvgMiles" 
                              FilterControlAltText="Filter column5 column" HeaderText="AvgMiles" HeaderStyle-Width="25px"
                              UniqueName="column5">
                          </telerik:GridBoundColumn>
                            
                          <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
                              ConfirmDialogType="RadWindow" ConfirmText="Delete this CAPID ?" 
                              ConfirmTitle="Confirm Delete" Text="Delete" UniqueName="DeleteColumn">
                              <ItemStyle CssClass="DeleteButton" HorizontalAlign="Center" />
                          </telerik:GridButtonColumn>
                      </Columns>
                      <EditFormSettings>
                          <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                          </EditColumn>
                      </EditFormSettings>
                  </mastertableview>
               <clientsettings>
                      <Scrolling AllowScroll="True" SaveScrollPosition="true"  ScrollHeight="625px" />
                  </clientsettings>
                  <filtermenu enableimagesprites="False">
                  </filtermenu>
              </telerik:RadGrid>
Sebastian
Telerik team
 answered on 24 Aug 2011
3 answers
146 views
I implemented an Outlook Web Access type mailbox using RadGrid eons ago and have only had to perform minor maintenance over the years. It is currently using Q1 2011 controls and has been limited to single row selections. I capture the client side rowclick event and perform a callback to the server passing the newly selected index as an argument. Server side I reset the colour of the previously selected row (grid.SelectedItems[0]) and unselect it, then darken the colour of the newly selected row (the index of which was passed as an argument in the callback), selecting it server side.

My client now wants to enable multirow select (to delete multiple emails, for example). I would of course like to do this with as few changes as possible, but during the callback, the server does not know whether the newly selected row is part of a multiple selection or a single selection, so it does not know whether the previously selected row needs to be unselected or not. Is there any argument that I can pass to the server as part of the callback which indicates whether the ctrl key was depressed at the time of the new selection (or, even better, an attribute of the grid that shows which is the current selection "mode")? If not, what's the best way of reading all selected row indexes client side so that I can pass an argument array to the server?

Many thanks.
Pavlina
Telerik team
 answered on 24 Aug 2011
1 answer
60 views
Hi,

I have tried implementing multiple comboboxes (2 comboboxes) from example
http://mono.telerik.com/Combobox/Examples/Functionality/MultipleComboBoxes/DefaultCS.aspx

Its working fine. Now If I set the selected value like

FirstcomboBox.SelectedValue = somevalue

for 1st combobox (on page load) I want to fire event to load the 2nd combobox currently which is not working. Do I need to set any property for this?


Thanks,
Balaji
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Aug 2011
1 answer
86 views
<ajaxpanel>
     <httppanel>
          <radgrid>
              <checkbox>
              </checkbox>
          </radgrid>
          <button>
          </button>
      </httppanel>
</ajaxpanel>
hi,
i have radgrid whic contains checkboxes, this rad grid is placed inside an xmlhttppanel whic is placed inside an ajax panel. A button is placed inside the ajaxpanel ,like shown above
no under the 'OnClick' (server side) event of the button am tracking the selected checkboxes, this doest works for the first button click. but it works after the first click ... any solutions..?

Pero
Telerik team
 answered on 24 Aug 2011
1 answer
362 views
I have created a RadGrid dynamically and added it to a placeholder at Page_Init event.

I'd need to add a custom button to the CommandItem and for this I've tried many scenarios and none of which has worked properly:

1) I added the custom button at RadGrid_ItemCreated event. The button appears. When it's clicked, it posts back, however, its click event handler is never raised. why? how to fix it?

My button is a normal ASP.NET button:

private Button CreateExportToPdfButton()
        {
            var result = new Button();
            result.ID = "btnExportToPdf";
            result.Click += ExportToPdfButtonClick;
            result.CssClass = "rgExpPDF";
            result.CommandName = "ExportToPdfCustomCommand";
            result.Attributes["title"] = "Export to Pdf";
            return result;
        }

Also I tried managing it in the ItemCommand event when the button is clicked: 

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)       
{
    if(e.CommandName == "ExportToPdfCustomCommand")
    {
        //my code here
    }
}

but ItemCommand event doesn't get raised either when the button is clicked.

2) I added the custom button at RadGrid_MasterTableView_Load. The button appears and when it's clicked, it posts back and click event is raised as expected which is great. As soon as sorting is enabled on the RadGrid and a column header is selected to be sorted, the sorting happens however my custom button disappears. Why? how to fix it?

3) On RadGrid_MasterTableView_Init; behaves similar to #2

4) On RadGrid_MasterTableView_PreRender; behaves similar to #1

5) On RadGrid_Init, behaves similar to #2

6) Another possible approach comes to mind is to create a new CommandItemTemplate: http://www.telerik.com/help/aspnet/grid/grdcommanditemtemplate.html

in which case, the click event and itemcommand events are raised properly.

But there is an issue with this approach that it would be more complex as I'm using the built-in Export to Word and Excel functionalities of RadGrid currently. so not sure how to add these 2 to the CommandItemTemplate this way?

I'd rather making the previous approaches working if possible.

Your help is very much appreciated on any of these approaches.
Vasil
Telerik team
 answered on 24 Aug 2011
3 answers
179 views
Hello,

I try to implement custom filter control like here. I put a textbox and button into template column and everything now shows fine in filter row. But I need to set custom button which will contain fully custom filter menu. I want it to display when I press the button and send a filter command  when menu item is selected. But right now I can't event start built-in filter menu. I tried to add button onclick event like on your demo page, i.e.
$find("RadGrid1")._showFilterMenu("RadGrid1_ctl00", "ContactName", event); return false; __doPostBack('RadGrid1$ctl00$ctl02$ctl02$Filter_ContactName','')
but I always get a JS error  here:
this._buildFilterMenuItemList(this._filterMenu,f._data.FilterListOptions,f._data.DataTypeName,f._data.CurrentFilterFunction,f);
If I translate it to English, it's going to be like "Cannot get a value for _data; it's not defined or has a null value". Something like this.
So I have 2 questions:
  a. Is this possible to display built-in filter menu when clicking on custom button inside a filter template?
  b. Is this possible to built a fully custom menu and make it work the same way as built-in?
Thank you.
Dmitry
Top achievements
Rank 1
 answered on 24 Aug 2011
1 answer
151 views
Hi,

I am trying to load my second combobox based on the item selected from first combobox. The code goes something like this

Aspx page

<telerik:RadComboBox ID="DepartmentDD" runat="server" OnItemsRequested="DepartmentDD_ItemsRequested" OnClientSelectedIndexChanging="LoadSection" OnClientItemsRequested="ItemsLoaded" width="175px"/>


<telerik:RadComboBox ID="SectionDD" runat="server" OnItemsRequested="SectionDD_ItemsRequested" OnClientItemsRequested="ItemsLoaded" width="175px" />   


function ItemsLoaded(combo, eventarqs) {

    var secCombo = $find("SectionDD");
    if (combo.get_items().get_count() > 0) {
        combo.set_text(combo.get_items().getItem(0).get_text());
        combo.get_items().getItem(0).highlight();
    }
                    combo.showDropDown();
}


function LoadSection(combo, eventarqs) {
    var seccombo = $find("SectionDD");
    var item = eventarqs.get_item();

    seccombo .set_text("Loading...");
    seccombo .requestItems(item.get_value(), false);
}


---------

CS page


 protected void Page_Load(object sender, EventArgs e)
{

    LoadDepartment();

}
      

    protected void LoadDepartment()
        {
        //Loads department to DepartmentDD
        }


        protected void DepartmentDD_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            LoadDepartment();
        }

        protected void SectionDD_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {

            LoadSection(Convert.ToInt16(deptid));
        }

        protected void LoadSection(int deptId)
        {
            
          //Loads section to SectionDD
        }


The problem is when I reach SectionDD_ItemsRequested after selecting item from first combo the control is firing OnInit method which loads the deparment againg :(.

Where am I going wrong?
Dimitar Terziev
Telerik team
 answered on 24 Aug 2011
4 answers
167 views
Hello,
Can you please tell me how do I exactly call fireCommand on filtering? According to this help page I have to pass 4 parameters, like
fireCommand("Filter", colName, expression, function).
According to some pretty old forum post, I have to pass 2 parameters, like
fireCommand("Filter", colName + "|" + expression + "|" +  function)
I tried everything but I always get Index out of bounds error. Page_Load event fires correctly  but it never comes into ItemCommand event.
Calling mastertableview.filter() function will not fire postback. So what should I do to initiate filtering from client side?
Dmitry
Top achievements
Rank 1
 answered on 24 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?