Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
721 views
I want only some of columns to be editable in my RadGrid. I have GridEditCommandColumn, GridBoundColumns (for them I dont want to be editable) and GridTemplateColumns (they need to be editable). Is that possible and how?
Gowtama Krishna
Top achievements
Rank 1
 answered on 14 Feb 2017
5 answers
201 views
Hello, I have an issue with radgrid static headers runing on IE compatibility mode, any solution?

<
telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" AutoGenerateColumns="false" runat="server">
    <ClientSettings>
        <Scrolling AllowScroll="true" ScrollHeight="500" UseStaticHeaders="true" />
    </ClientSettings>
    <MasterTableView TableLayout="Fixed" runat="server">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="IdProvincia" />
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="Provincia" />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <Columns>
            <telerik:GridBoundColumn DataField="Airport" HeaderText="Provincia" ItemStyle-Width="100px" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LAT" HeaderText="LAT" ItemStyle-Width="100px" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LNG" HeaderText="LNG" ItemStyle-Width="100px" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LAT" HeaderText="LAT" ItemStyle-Width="100px" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LNG" HeaderText="LNG" ItemStyle-Width="100px" HeaderStyle-Width="100px"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
KidSysco
Top achievements
Rank 1
 answered on 14 Feb 2017
1 answer
309 views
Such as title.
Rumen
Telerik team
 answered on 14 Feb 2017
3 answers
169 views

I think I'm missing something obvious, but I surrender.  I have an editor with the image manager tool enabled.  Below is my code behind code setting it all up, you can see that I create the directory if it is not there.  The image uploads successfully and is in the right directory.  However I am getting these three errors

  • After an upload – You are trying to navigate to a non-existing folder or you do not have proper permissions…
  • After I try the Image Edit - ImageEditor_Common_MessageCannotWriteToFolder
  • After I try to Delete – The selected file could not be deleted because the application did not have enough permissions.

 Any hints would be greatly appreciated.

'set imagemanager paths
Dim sImage As String = SSG.BYOC.Shared.Resource.GetClassroomSaveToFilePath(AppConfig.ClassroomFileUploadRoot, ClassID)
Dim sImagePath As String = Server.MapPath(sImage)
Dim imagePath As String() = New String() {sImage}
' Dim imageFilters As String() = New String() {"gif", "jpg", "jpeg", "png"}
 
If Directory.Exists(sImagePath) = False Then
    Directory.CreateDirectory(sImagePath)
End If
 
'ctlDescription.ImageManager.SearchPatterns = imageFilters
ctlDescription.ImageManager.ViewPaths = imagePath
ctlDescription.ImageManager.UploadPaths = imagePath
ctlDescription.ImageManager.DeletePaths = imagePath

Vessy
Telerik team
 answered on 14 Feb 2017
0 answers
147 views

when creating groups dynamically to a grid with template columns, the application is throwing an unhandled exception error if the groupbe by column holds null values.  If the underlying data source is modified to replace null values with "" then the grid functions fine.  The way its to behave the columns to be grouped by can change so I need a way to handle nulls in the application code.  Does anyone have a solution for this?

 

 

                Dim ex As New GridGroupByExpression()
                For Each dRow As DataRow In objDS.Tables(2).Rows
                    Dim field1 As New GridGroupByField()
                    field1.FieldName = dRow("Column_Name")
                    field1.HeaderText = dRow("display_name")
                    field1.SortOrder = dRow("Sort_Order")
                    ex.GroupByFields.Add(field1)
                    ex.SelectFields.Add(field1)

                Next

                EditGrid.MasterTableView.GroupByExpressions.Add(ex)

 

John
Top achievements
Rank 1
 asked on 14 Feb 2017
2 answers
362 views

I've searched the forums with no luck. 

What I need to do is send an email with the ID of the newly inserted items ID that is generated from SQL(isIdentity)

I was assuming that I could get this info from RadGrid1_ItemInserted but no luck.

Dim editformItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
Dim test As String = editformItem.Item("Task_Id").Text

-DataKeyNames="Task_Id"

I need the id of the inserted item.

Can someone please help.

Thank you


 

Eyup
Telerik team
 answered on 14 Feb 2017
0 answers
114 views

hi

I have an item "Billing & Orders" in the item text and is giving me an error that is caused by "&". When i changed to "Billing and Orders", it works fine. Is there a way to have an "&" in the item text instead of "and"? Thanks a lot.

L
Top achievements
Rank 1
 asked on 14 Feb 2017
0 answers
101 views

 

Like picture, how to change?

wang
Top achievements
Rank 1
 asked on 14 Feb 2017
0 answers
81 views

Not sure whether to use a RadGrid or some other solution here...

I have a database table with x, y coordinate, and a content field.

I want to plot the content in a grid according to the x,y and knowing the size of the total grid, ie 12x6, or 20x10, etc...

Some cells may be empty (no row in the table).

Suggestions?

 

 

 

Greg
Top achievements
Rank 1
 asked on 13 Feb 2017
2 answers
186 views

Hi 

I'm having problems with the grid losing the dynamic column metadata when using the batch edit "save changes" and cancel changes" buttons.  See the attached pictures. The grid is declared in the ASPX page and the columns are assigned in the page_load event only on the first page load.

Here is the grid declaration:

<telerik:RadGrid
    ID="radGridGrades"
    runat="server"
    AllowPaging="false"
    Width="100%"
    enableEmbeddedSkins="false"
    Skin="CorpsNETBootstrap"
    AllowSorting="true"
    ClientSettings-Selecting-AllowRowSelect="true"
    AllowMultiRowSelection="true"
    ClientSettings-AllowKeyboardNavigation="true"
    ItemStyle-HorizontalAlign="Center"
    HeaderStyle-HorizontalAlign="Center"
    AlternatingItemStyle-HorizontalAlign="Center"
    AllowMultiRowEdit="true"
    OnBatchEditCommand="radGridGrades_BatchEditCommand"                                            
    OnNeedDataSource="radGridGrades_NeedDataSource"
    OnItemDataBound="radGridGrades_ItemDataBound">                                           
    <MasterTableView
        AutoGenerateColumns="False"
        DataKeyNames="ID"
        Width="100%"
        CommandItemDisplay="Top"
        CommandItemStyle-Height="15px"
        CommandItemSettings-ShowCancelChangesButton="true"
        CommandItemSettings-ShowAddNewRecordButton="false"                                               
        PageSize="10"
        EnableNoRecordsTemplate="true"
        EditMode="Batch"
        InsertItemPageIndexAction="ShowItemOnCurrentPage">                                               
        <Columns>
        </Columns>
        <EditFormSettings>
            <PopUpSettings ScrollBars="None" />
        </EditFormSettings>
        <NoRecordsTemplate>
            <div align="center" style="color:darkorange">---------- No Records to Display -----------</div>
        </NoRecordsTemplate>
    </MasterTableView>
    <ClientSettings>
    </ClientSettings>
</telerik:RadGrid>                       

 

And here is the code-behind for the page:

public partial class GradesByClass : CorpsNET.BasePage
{
    CorpsNETServer.ScheduledClass _scheduledClass;
    CorpsNETServer.Lookup _academicSchedule;
    CorpsNETServer.AcademicAssignment _academicAssignment;   
 
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
 
        if (Request.QueryString["ScheduledClassID"] != null)
        {
            _scheduledClass = ScheduledClassService.GetByID(Int32.Parse(Request.QueryString["ScheduledClassID"]));
        }
 
        if (!Page.IsPostBack)
        {
            if (((UserProfile)Session["_userProfile"]).IsAuthorized("Grades - Edit") == true)
            {
                Master.SetLocation("GradesByClass.aspx", "Grade Entry for:  <b>" + _scheduledClass.SubjectName + "</b>", true);
            }
            else
            {
                throw new CorpsNETServer.CorpsNETAuthException("Grades - Edit");
            }
            
            //rdpRosterDate.SelectedDate = DateTime.Now;
            lblClassPeriod.Text = _scheduledClass.ClassPeriodName;
            lblClassroom.Text = _scheduledClass.ClassroomName;
            lblClassSchedule.Text = _scheduledClass.ClassroomScheduleName;
            lblSubject.Text = _scheduledClass.SubjectName;
            lblTeacher.Text = _scheduledClass.TeacherName;
            lblTrimester.Text = _scheduledClass.TrimesterName;
 
            LoadGridStructure();
        }
    }
 
    public void LoadGridStructure()
    {
        radGridGrades.Columns.Add(new GridBoundColumn() { ReadOnly=true,  UniqueName = "Corpsmember", DataField = "EmployeeName", HeaderText = "Corpsmember", SortExpression = "EmployeeName" });
        radGridGrades.Columns.Add(new GridBoundColumn() { ReadOnly = true, UniqueName = "AcademicScheduleName", DataField = "AcademicScheduleName", HeaderText = "Academic Schedule", SortExpression = "AcademicScheduleName" });
        radGridGrades.Columns.Add(new GridBoundColumn() { ReadOnly = true, UniqueName = "CurrentStatusName", DataField = "CurrentStatusName", HeaderText = "Current Status", SortExpression = "CurrentStatusName" });
 
        List<AcademicAssignment> _academicAssignemnts = AcademicAssignmentService.GetForScheduledClass(_scheduledClass.ID);
 
        for (int i = 0; i < _academicAssignemnts.Count; i++)
        {
            radGridGrades.Columns.Add(new GridBoundColumn() { UniqueName = _academicAssignemnts[i].ID.ToString(), HeaderText = "Assignment: <a href='#' class='RadGrid_CorpsNETBootstrap_a' onclick =openEditAcademicAssignmentWindow(" + _academicAssignemnts[i].ID + "); return false;>" + _academicAssignemnts[i].Name + "</a> Due Date: <b>" + _academicAssignemnts[i].DueDateString + "</b>" });
        }
    }
 
    public void LoadStudents()
    {
        radGridGrades.DataSource = EmployeeService.GetForScheduledClass(_scheduledClass.ID);
    }
 
    protected void radGridGrades_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridEditableItem form = (GridEditableItem)e.Item;
 
            int employeeid = Int32.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString());
 
            //goto through all the assignments and load any existing grades for that assignment
            List<AcademicAssignment> _academicAssignments = AcademicAssignmentService.GetForScheduledClass(_scheduledClass.ID);
 
            for (int i = 0; i < _academicAssignments.Count; i++)
            {
                //radGridGrades.Columns.Add(new GridBoundColumn() { UniqueName = _academicAssignemnts[i].ID.ToString(), HeaderText = "Assignment: <b>" + _academicAssignemnts[i].Name + "</b> Due Date: <b>" + _academicAssignemnts[i].DueDateString + "</b>" });
                //get the grade for this assignment and Employee
                Grade _grade = GradeService.GetForAcademicAssignment(employeeid, _academicAssignments[i].ID);
 
                if (_grade != null)
                {
                    if (_academicAssignments[i].LetterGrade == true)
                        form[_academicAssignments[i].ID.ToString()].Text = _grade.LetterGrade;
                    else
                        form[_academicAssignments[i].ID.ToString()].Text = _grade.Points.ToString();
                }
                else
                    form[_academicAssignments[i].ID.ToString()].Text = string.Empty;
            }
        }       
    }
 
    protected void radGridGrades_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        LoadStudents();
    }
 
    protected void radGridGrades_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
    {
        //todo
    }
 
}

 

On the first page load everything works fine.  (see pic 1)  I want to edit only the values in a single column.  I'm aware that I have not yet implemented the save code.  the problem is that the first columns lose their definitions after postback by either the 'cancel changes' or 'save changes' batch edit buttons.  CAn you point me in the right direction?  Thanks.

Jonathan
Top achievements
Rank 1
 answered on 13 Feb 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?