Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
135 views

I have a RadDateInput control in a user control for a website:

 <telerik:RadDateInput rendermode="lightweight" id="calOneOff" runat="server" EmptyMessage="Enter valid date" DBSelectedDate='<%# Bind("OneOffDate")%>' SkipMinMaxDateValidationOnServer="true"></telerik:RadDateInput>

 

The original data is from the database, there the OneOffDate field can either have a valid date, or null values.

As I pick this up in visual studio and store the value in a list of objects, the OneOffDate value is held in a property also called OneOffDate, which is a DateTime datatype.  As a result, the stored value for null values is "01/01/0001" (New Zealand culture, so day/month/year).

Unfortunately this causes the RadDateInput to show this value (01/01/0001) on the page, along with a little exclamation mark icon (as its too far back in the past to be a valid date).  Is there a way so that if the date is outside a certain range (e.g. before the year 2000) it will show a blank value on the RadDateInput control when databinding?

Thank you

 

 

Rem
Top achievements
Rank 1
 answered on 01 Feb 2016
2 answers
398 views

I need to create stacked bar data from code and cannot find a working example.  Below is some code I've pieces together from other samples this does group the bars but they are not stacked correctly.  I can make this work in a RadChart but we are trying to move away from the old control

 

<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="625" >
    <ChartTitle Text="My test chart"/>
</telerik:RadHtmlChart>

 

        protected void Page_Load(object sender, EventArgs e)
        {
 
 
            int numSeries = GetData().Columns.Count - 2;
 
            for (int i = 0; i < numSeries; i++)
            {
                BarSeries currLineSeries = new BarSeries { DataFieldY = GetData().Columns[2 + i].Caption, Stacked = true, StackType = HtmlChartStackType.Normal, GroupName = "Weeks", Gap = 2 };
                RadHtmlChart1.PlotArea.Series.Add(currLineSeries);
            }
 
 
            RadHtmlChart1.PlotArea.XAxis.DataLabelsField = "Weeks";
            RadHtmlChart1.DataSource = GetData();
            RadHtmlChart1.DataBind();
}
 
 protected DataTable GetData()
        {
            DataTable dt = new DataTable();
 
            dt.Columns.Add("ID");
            dt.Columns.Add("Weeks");
            dt.Columns.Add("a111");
            dt.Columns.Add("a112");
            dt.Columns.Add("a119");
 
 
            dt.Rows.Add(1, "1/3/2011", 4, 46, 117);
            dt.Rows.Add(2, "1/10/2011", 12, 62, 112);
            dt.Rows.Add(3, "1/17/2011", 6, 79, 132);
 
 
            return dt;
 
        }

John
Top achievements
Rank 1
 answered on 01 Feb 2016
0 answers
90 views

My initial impression is this feature has potential, but is not quite "ready for prime-time". The documentation is certainly lacking, which may be one of the reasons I have this impression. I'm not sure why you would release such a potentially complex and feature-rich item with so little documentation. Anyhow, here are some of my concerns on initial attempt to use the excel-like filtering as I have your other filtering options. Perhaps some of these are real issues and other may simply be that there is no documentation.

 

1) it would appear that the ChecklistWebServicePath property does not respect "~" notation for the app root. All your other web-service implementations do. This should as well.

2) your online examples do not indicate how to pass context information to the web service being used to bind the Excel-like filtering checklist. And there doesn't appear to be a client-side event handler (or maybe its just not documented) for requesting the checklist filter items. You shouldn't be providing examples that don't include the obvious requirement of passing context info to the web service.

3) How does one access the checklist filter selections sever-side in order to perform custom filtering? In the grid ItemCommand handler, checking the filter command and looking at the CommandArgument, the pair.Second correctly references the column name, but the pair.First is equal to 0. I would like to determine which checklist items are selected, so I can pass that info to my Stored Proc in order to filter the records prior to rebinding. In fact, I would like to be able to access all the excel-like filtering info, in addition to the checklist items in order to perform custom filtering.

4) in the attached, you can see the checklist items are not aligned properly to look good in the skin. This is Office2007, but I have seen similar issues in other skins.

5) When items in the checklist are selected, there is no indication to the user that the column filter is being used. The filter text box remains empty. This makes sense because there wouldn't be room to fill the box with the selected items (nor would you want to). However, there needs to be some way to indicate to the user that the grid is filtered by that column. I would recommend you guys use a different icon (like Excel does) or even a different color for the filter icon to indicate the column is filtered.

6) Per #3 above, there would need to be a way to set the filter values server-side prior to binding (in essence an "initial filter state") so that a grid can be displayed as filtered the first time it is loaded. This can already be done with your built-in filtering and custom filter templates. Its needs to be available through Excel like filtering as well. This would again necessitate the ability to pass context information to the webservice which obtain the checklist items since some would need to be returned already checked and others not.

 7) you may want to consider having the checklist items all checked by default. This would indicate the "not filtered" state. This is not a huge deal, but its is how thing are done in Excel and makes sense.

Albert Shenker
Top achievements
Rank 1
Veteran
Iron
 asked on 01 Feb 2016
3 answers
370 views

Is it possible to reposition the title in the kendowindow?

thanks

Robert

 

Robert
Top achievements
Rank 1
 answered on 01 Feb 2016
5 answers
286 views
Hi,

I am working with radgrid control, the problem description as below :-

I have a check box as a first column in the grid and I can select multiple rows, I need to get one cell value [Id] at the server side on when I select rows and click on the save button , on the save button click event.

Can you tell me how can i achive this??
Eyup
Telerik team
 answered on 01 Feb 2016
4 answers
387 views

Hi Everyone,

 I upgraded to ASP.NET AJAX 2016 Q1 today, and I've been receiving this error once in awhile.  I'm not sure exactly what causes it.

 I don't see it list any of my code.  It does only occur on one page (so far).  In this page I do two things related to grouping.  In the 'DetailTableDataBind' event I group by a specific field:

                e.DetailTableView.GroupByExpressions.Clear();
                var gridGroupByExpression = new GridGroupByExpression();
                gridGroupByExpression.GroupByFields.Add(new GridGroupByField { FieldName = "FIELD NAME", SortOrder = GridSortOrder.Descending });
                gridGroupByExpression.SelectFields.Add(new GridGroupByField { FieldName = "FIELD NAME", HeaderText = "HEADER TEXT", Aggregate = GridAggregateFunction.Avg, FormatString = "{0:0}" });
                gridGroupByExpression.SelectFields.Add(new GridGroupByField { FieldName = "FIELD NAME", HeaderText = "HEADER TEXT", Aggregate = GridAggregateFunction.Avg });
                e.DetailTableView.GroupByExpressions.Add(gridGroupByExpression);

 And in the 'GroupsChanging' event, I disable paging if at least one column is being grouped by:

(sender as RadGrid).AllowPaging = !(e.Action != GridGroupsChangingAction.Ungroup || e.TableView.GroupByExpressions.Count > 1);

 

Here's the full exception:

 System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException (0x80004005): Multiple controls with the same ID '_LightweightGroupPlaceHolder' were found. FindControl requires that controls have unique IDs.
    at System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls)
    at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)
    at Telerik.Web.UI.GridGroupPanel.AddLightweightGroups(GridTableView tableView, Int32 level, Int32& tableIndex)
    at Telerik.Web.UI.GridGroupPanel.InitializeIn(RadGrid grid, Boolean FromViewState)
    at Telerik.Web.UI.RadGrid.CreateGroupPanel(Control container)
    at Telerik.Web.UI.RadGrid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
    at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at Telerik.Web.UI.GridBaseDataList.get_Controls()
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
    at System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
    at System.Web.UI.Page.LoadAllState()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Pavlina
Telerik team
 answered on 01 Feb 2016
3 answers
99 views

We have an ASP.NET forms app which makes use of the Telerik RadGrid. One particular page has some code that allows the user's search criteria to be remembered (not sure if this relevant). 

Quite often when adding updated or new pages to the same folder the page with the RadGrid starts crashing even though this page hasn't been updated itself. It seems more likely to crash for people who were using the page when the other content changed as it doesn't normally affect everybody. The problem can normally be cleared up by recycling the application pool or resetting IIS (Which isn't always possible to do quickly)

We have recently moved to a new web server (Windows 2012 / IIS8). We had the problem on the old server  too - I was hoping the server move would help but it hasnt. Can anyone offer any advice?

Part of the error is pasted below

A]GridSettingsCollection cannot be cast to [B]GridSettingsCollection. Type A originates from 'App_Code.tjhpcefj, 

Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Windows\Microsoft.NET

\Framework64\v4.0.30319\Temporary ASP.NET Files\root\4d0bd47d\b6b2e877\App_Code.tjhpcefj.dll'. Type B originates from 

'App_Code.oxtbck2r, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:

\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\4d0bd47d\b6b2e877\App_Code.oxtbck2r.dll'.

Source Error: 

Line 370:    Public Shared Function LoadFromSerializedData(ByVal data As String) As GridSettingsCollection
Line 371:        Dim formatter As New LosFormatter()
Line 372:        Return DirectCast(formatter.Deserialize(data), GridSettingsCollection)
Line 373:    End Function

Maria Ilieva
Telerik team
 answered on 01 Feb 2016
2 answers
99 views
Hello Telerik, Im trying to enable multi row select in rad grid without a check box for selecting, only on any row cell click i can select, and on another row click, it keep the previous selected row, im trying to do so client side, is there any way to implement that
Bishara
Top achievements
Rank 1
 answered on 01 Feb 2016
1 answer
244 views

 I am able to change the values of all the controls in my telerik grid in the ItemDataBound method except those in the HeaderTemplate
How can I access those controls?

 

<telerik:GridTemplateColumn UniqueName="TemplateColumnOne" >

<HeaderStyle >

</HeaderStyle>

<HeaderTemplate >

<asp:Label ID="lblToolTip" runat="server" ></asp:Label>

</HeaderTemplate>

<ItemTemplate>

<asp:Label id="lblPermitNumber" runat="server"></asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

 

protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)

{

var item = e.Item as GridDataItem;

TableCell documentColumn = item["TemplateColumnOne"];

var lblPermitNumber=(Label)documentColumn.FindControl("lblPermitNumber");

lblPermitNumber.Text = "some text; // how do you access LblToolTip ?

}

 

 

I am able to change the values of all the controls in my telerik grid in the ItemDataBound method except those in the HeaderTemplate

How can I access those controls?

      <telerik:GridTemplateColumn UniqueName="TemplateColumnOne" >
      <HeaderStyle ></HeaderStyle>
      <HeaderTemplate >                                  
      <asp:Label ID="lblToolTip"  runat="server"  onclick="showToolTip(this);"></asp:Label>                     
      </HeaderTemplate>
            <ItemTemplate>                                   
               <asp:Label id="lblPermitNumber" runat="server"></asp:Label>                  
             </ItemTemplate>
       </telerik:GridTemplateColumn>


    protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)
    {
    var item = e.Item as GridDataItem;
    TableCell documentColumn = item["TemplateColumnOne"];
    var lblPermitNumber=(Label)documentColumn.FindControl("lblPermitNumber");
     lblPermitNumber.Text = "some text;
    // how do you access LblToolTip ?
         }

I am able to change the values of all the controls in my telerik grid in the ItemDataBound method except those in the HeaderTemplate

How can I access those controls?

      <telerik:GridTemplateColumn UniqueName="TemplateColumnOne" >
      <HeaderStyle ></HeaderStyle>
      <HeaderTemplate >                                  
      <asp:Label ID="lblToolTip"  runat="server"  onclick="showToolTip(this);"></asp:Label>                     
      </HeaderTemplate>
            <ItemTemplate>                                   
               <asp:Label id="lblPermitNumber" runat="server"></asp:Label>                  
             </ItemTemplate>
       </telerik:GridTemplateColumn>


    protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)
    {
    var item = e.Item as GridDataItem;
    TableCell documentColumn = item["TemplateColumnOne"];
    var lblPermitNumber=(Label)documentColumn.FindControl("lblPermitNumber");
     lblPermitNumber.Text = "some text;
    // how do you access LblToolTip ?
         }

I am able to change the values of all the controls in my telerik grid in the ItemDataBound method except those in the HeaderTemplate

How can I access those controls?

Eyup
Telerik team
 answered on 01 Feb 2016
4 answers
146 views
In my RadGrid, I am creating columns dynamically in code behind. One column is a GridDropDownColumn which is created as follows.
GridDropDownColumn columnn = new GridDropDownColumn();
TRG.MasterTableView.Columns.Add(columnn);
 
columnn.ListDataMember = "Department";
columnn.DataField = "Id";
columnn.ListTextField = "Name";
columnn.ListValueField = "Id";
columnn.DropDownControlType = GridDropDownColumnControlType.RadComboBox;
columnn.UniqueName = "Department";
columnn.HeaderText = "Department";

ListDataMemeber is set to corresponding table name in DataSet to which the RadGrid is bound.

Now, this column appears fine in as a Bound Column Display mode , and appears as a RadComboBox in Edit Mode, with correct values.

However, the issue is that the "ExtractValuesFromItem" in Radgrid_UpdateCommand doesn't get the value for this GridDropDownColumn.
protected void MyGrid_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    Hashtable NewData = new Hashtable();
    e.Item.OwnerTableView.ExtractValuesFromItem(NewData, (GridEditableItem)e.Item);
}

If there are total 12 columns in my RadGrid, then, there are 11 in "NewData" hashtable, and the GridDropDownColumn's value is missing.

What is the correct way to achieve this?
Brian
Top achievements
Rank 2
 answered on 01 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?