Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
151 views
I am using Entity Framework in this instance and would like to group my radgrid by a field located in another table related to the main item.  I have used an include statement to bring back the additional entity (one to one relationship between these tables) as lazy loading is enabled.  I want to group on "Title" field in my table "Activity"  The navigation property is "Activity1" so I have used the following to populate my datasource:

 _context.LEResults.Include("Activity1").Where(R => R.EmployeeID == EmployeeId && R.Active == true).OrderBy(E => E.AttemptDate).ToList();

I know this is working because I can display Activity1.Title as a regular gridboundcolumn.

I have got this to work before and actually have the other project in front of me but I cannot figure out what is different.  Is there anything anyone can think of that I may have missed?  The following code informs me that the field Activity1.Title is missing from my source table.

<GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="Activity1.Title" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="Activity1.Title" HeaderText="Activity" />
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
</GroupByExpressions>


Robin
Top achievements
Rank 1
 answered on 29 Apr 2014
1 answer
150 views

I have a situation where where I need to only fired the needDatasource on a boolean statment.  It works fine for what I am doing to load the page on a querystring value.  Where the grid hiccups is when I try to use the Radgrid insert, the grid disappears becuase of the boolean statment, how can I set this statement when I postback to get at my template to insert data.

Dim fillGridNotes As Boolean = False
    Dim fillGridEmer As Boolean = False
 
    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim rspId As String = Request.QueryString("RSP")
 
            If rspId = String.Empty Then
                'Send to another page
            Else
                Dim userlogon As String = Split(Current.User.Identity.Name, "\")(1)
                HFUserId.Value = GetPersId(userlogon)
                HFRecruitId.Value = rspId
 
                LoadRSP(rspId)
                fillGridNotes = True
            End If
        End If
    End Sub
 
 
 
This is where I cannot ge thte grid to open to allow me to fill out the form and then postback to fill the grid.
 
 
  Protected Sub myRadNotes_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles myRadNotes.ItemCommand
        If (e.CommandName = RadGrid.PerformInsertCommandName) Then
            fillGridNotes = True
            Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
            Dim notes As TextBox = DirectCast(editedItem.FindControl("txtNotes"), TextBox)
            Dim rspId As Integer = 16533
 
            sql = "Insert tblRSPNotes (intRSPId, dtRSpNotesDateEntered, strRSPNotesDesc, intLoggedBy) VALUES (" & rspId & ", '" & Date.Now & "', '" & sanitizeString(notes.Text) & "', " & HFUserId.Value & ")"
 
            insertUpdateDelete(sql)
 
            myRadNotes.Rebind()
        End If
    End Sub
 
    Protected Sub myRadNotes_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadNotes.NeedDataSource
        'Load the Notes Grid
        If fillGridNotes = True Then
            sql = "Select intRspNotesId, CONVERT(varchar(10), dtRSPNotesDateEntered, 111) dtNotes, strRSPNotesDesc, mn.strFullname + ' ' + ISNULL(' ' + strRank, '') LoggedBy from tblRSPNotes n LEFT JOIN MNNGPersonnel..tblMNNatPersonnel mn on " _
                & "mn.intPersonnelId = n.intLoggedBy where intRSPID in (Select intRSpId from tblRSp where intRecruitId = " & HFRecruitId.Value & ") Order by dtRSPNotesDateEntered DESC"
 
            myRadNotes.DataSource = getReader(sql)
        End If
    End Sub


























Konstantin Dikov
Telerik team
 answered on 29 Apr 2014
1 answer
76 views
i'm having an issue setting up those two parameters when the key coming from the database is arabic
Conversion failed when converting the nvarchar value 'ج' to data type int
this error occurred, can anyone please tell me what the best way to make my radtreeview work ?
Boyan Dimitrov
Telerik team
 answered on 29 Apr 2014
1 answer
454 views
Hi I am using a multiselect radcombobox where i am binding the data dynamically at code behind. There is a rad button too on the page. On button click event I am always getting the CheckedItems.count = 0 at code behind. However if I am adding items in radcombo at UI side, I am able to get CheckedItems.count. Please suggest is there any way to get CheckedItems.count when data is binding dynamically at code behind. 
Shinu
Top achievements
Rank 2
 answered on 29 Apr 2014
1 answer
143 views
Hi,

I am trying to Bind RadhtmlChart my column name contains '.' when this appears in the column it is throwing error,how can I handle this.

EX:

       dt.Columns.Add("id");
        dt.Columns.Add("data..."); // This contains '.' at end of column 
    
        DataRow dr = dt.NewRow();       
        dr[0] = "2011-12";
        dr[1] = "500";
        dt.Rows.Add(dr);
        ColumnSeries cs = new ColumnSeries();
        cs.LabelsAppearance.Visible = false;
        cs.Name = dt.Columns[1].ToString();
        cs.DataFieldY = dt.Columns[1].ToString();
        radChart.PlotArea.XAxis.DataLabelsField = dt.Columns[0].ToString();
      
        radChart.PlotArea.Series.Add(cs);
        radChart.PlotArea.YAxis.MinValue = 0;
       
        cs.LabelsAppearance.ClientTemplate = "#= category #";
        cs.TooltipsAppearance.DataFormatString = "{0:N0}";
        cs.TooltipsAppearance.ClientTemplate = "#= category #: #= value #";
        radChart.PlotArea.XAxis.Type = Telerik.Web.UI.HtmlChart.AxisType.Category;
        radChart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "yyyy-MM";
        radChart.PlotArea.Series.Add(cs);
        radChart.PlotArea.XAxis.LabelsAppearance.Visible = true;
        radChart.DataSource = dt;
        radChart.DataBind();
Stamo Gochev
Telerik team
 answered on 29 Apr 2014
1 answer
258 views
Hello,
I want to change the back color Notification TitleBar.
How can i apply my own color for TitleBar?
Shinu
Top achievements
Rank 2
 answered on 29 Apr 2014
1 answer
135 views
Hi Iam having two Rad Comboboxes depending on selected value of first combobox(i.e--None Selected--) i have to display in second combobox also same text --None selected--  And vice versa...and other than --none selected-- if i selected then second combobox should show its respective data. .Please help me to solve this  problem.
Princy
Top achievements
Rank 2
 answered on 29 Apr 2014
9 answers
163 views
Hi
I am converting to the latest controls and I am getting the following runtime error:

    intKey is neither a DataColumn nor a DataRelation for table GroupedTable0.

This code is currently working with version 2010.3.1109 of controls.  The data for the grouped grid is coming from a stored procedure via a strongly types data adapter (i.e. dataset).  I am applying a filter on the data, prior to manually binding the grid.  When I bind the grid I get the above exception.
I have added a intKey column with visibility set to false to the columns collection but that did not help.

Phil
Shinu
Top achievements
Rank 2
 answered on 29 Apr 2014
6 answers
278 views
I can't seem to bind data to a drop down tree.

Markup:
<telerik:RadDropDownTree runat="server" ID="radGrades" DefaultMessage="Grade"></telerik:RadDropDownTree>

Code Behind:
RadDropDownTree gradeTree = item.FindControl("radGrades") as RadDropDownTree;
var grades = Grade.GetVGradeTypes();  //returns List<v_grade_type>, 6 items in list
gradeTree.Entries.Clear();
gradeTree.DataFieldID = "grade_id";
gradeTree.DataFieldParentID = "grade_type_id";
gradeTree.DataTextField = "grade";
gradeTree.DataSource = grades;
gradeTree.DataBind();

I should also note, this is being called from the "ItemDataBound" event on a RadGrid [adding a new item, haven't looked at editing an existing item].  The markup lives in the EditFormTemplate of the grid. 
Any ideas?
Mike
Top achievements
Rank 1
 answered on 28 Apr 2014
1 answer
130 views
Hello

Why in my version 2014.1.225.45, DropDownWidth="200px" or DropDownWidth="200"
doesn't work

The width it's ok : Width="240" but not the DropDownWidth

If i use the css , it's work , but i want to understand why the attributes DropDownWidth don't work


<telerik:RadComboBox runat="server" ID="PlaComboBox1" Width="240" DataSourceID="WbTA" DataTextField="TA_LIBELLE" DataValueField="TA_ID" DropDownWidth="200"></telerik:RadComboBox>

thanks
for you help
Ivan Zhekov
Telerik team
 answered on 28 Apr 2014
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?