This is a migrated thread and some comments may be shown as answers.

RADGRID w/ 3 Column (s) cannot type in the grid

6 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 13 Jul 2010, 03:54 PM
the  RADgrid  is populated via  CS  code
Now,  the data shows up in the grid   and columns(1,2) are READ ONLY
column (3) is not READONLY.
However,  you cannot type into  3rd column   to update the hours column 
    protected void Page_Init(object sender, System.EventArgs e)
    {
        DefineGridStructure(); // this method will populate  this  RadGrid1.
    }
    private void DefineGridStructure()
    {
        // populate  this  RadGrid1.
        string sqlCxn = "Data Source=DESQL2008;Initial Catalog=DrawOnTime;User Id=ontimeweb;Password=ontime1234;", sql2008;
        sql2008 = "select IncidentId, IncidentNumber, Incidents.Name, " +
        " CASE " +
        " WHEN DATEPART (YYYY,ReportedDate)=1899 THEN '  /  /   '" +
        " ELSE" +
        " CONVERT (char(8),ReportedDate,1)" +
        " END " +
        " as 'Reported Date'," +
        " Substring(Incidents.Description,1,72)+'\n'+" +
        " Substring(Incidents.Description,73,72)+'\n'+" +
        " Substring(Incidents.Description,145,72)+'\n'+" +
        " Substring(Incidents.Description,217,72) as IncidentDesc," +
         "Users.FirstName + ' '+" +
        "Users.LastName as 'IT Employee Assigned', WorkFlowSteps.StepName as 'Flow'," +
        "000.00 as nLabor, space(40) as workDescr" +
        " from incidents " +
        "left join WorkFlowSteps on Incidents.WorkFlowStepId = WorkFlowSteps.WorkFlowStepId " +
        "left join WorkLog on IncidentId = ItemId " +
        " left join Users on Users.UserId=Incidents.AssignedToId " +
        " where (WorkLogId is null and Left(WorkFlowSteps.StepName,6) <>'Closed' and Left(WorkFlowSteps.StepName,3) <>'UAT' and " +
        "Left(WorkFlowSteps.StepName,4)<>'Hold' ) and " +
        " ( AssignedToId=0 or AssignedToId = @UID ) ";
 
        SqlConnection dbconn = new SqlConnection(sqlCxn), dbconn2;
        dbconn2 = new SqlConnection(sqlCxn);
        dbconn.Open();
        dbconn2.Open();
 
        SqlCommand myCommand = new SqlCommand(sql2008, dbconn), mycommand2;
        mycommand2 = new SqlCommand(sql2008, dbconn2);
         
        SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand), myAdapter2;
        myAdapter2 = new SqlDataAdapter(mycommand2);
 
        DataSet ds = new DataSet(), ds2;
        ds2 = new DataSet();
 
        myCommand.Parameters.AddWithValue("UID", 5);       //Default.UID);
        myAdapter.Fill(ds);
//        if (ds.Tables[0].Rows.Count == 0)
           //            this.btnSubmit.Visible = false; //           .Enabled = false;
         
        mycommand2.Parameters.AddWithValue("UID", 5);
        myAdapter2.Fill(ds2);
 
        RadGrid1.DataSource = ds;
        RadGrid1.DataBind();
/*
        RadGrid2.DataSource = ds2;
        RadGrid2.DataBind();
        */
        RadGrid2.Visible = false;
 
 
 
//        RadGrid1.Visible = true;
    }
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
 
    </div>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"  Width = "817px"
     Height="341px"  MasterTableView-CanRetrieveAllData ="true"
      MasterTableView-Visible ="true" AllowAutomaticUpdates="True"     
        >
<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="IncidentNumber" HeaderText="Incident #"
            ReadOnly="True" UniqueName="column">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name" HeaderText="Subject"
            UniqueName="column1">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActualDuration" DataType="System.Decimal"
            DefaultInsertValue="0.00" HeaderText="Actual Duration" Resizable="False"
            UniqueName="column2">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
    </telerik:RadGrid>
    <telerik:RadGrid ID="RadGrid2" runat="server" GridLines="None"
        style="margin-top: 27px">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="IncidentId">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="IncidentId" DataType="System.Int32"
            HeaderText="IncidentId" ReadOnly="True" SortExpression="IncidentId"
            UniqueName="IncidentId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="IncidentNumber" HeaderText="IncidentNumber"
            SortExpression="IncidentNumber" UniqueName="IncidentNumber">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name" HeaderText="Name"
            SortExpression="Name" UniqueName="Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description" HeaderText="Description"
            SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReplicationProcedures"
            HeaderText="ReplicationProcedures" SortExpression="ReplicationProcedures"
            UniqueName="ReplicationProcedures">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Resolution" HeaderText="Resolution"
            SortExpression="Resolution" UniqueName="Resolution">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Notes" HeaderText="Notes"
            SortExpression="Notes" UniqueName="Notes">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PriorityTypeId" DataType="System.Int32"
            HeaderText="PriorityTypeId" SortExpression="PriorityTypeId"
            UniqueName="PriorityTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="StatusTypeId" DataType="System.Int32"
            HeaderText="StatusTypeId" SortExpression="StatusTypeId"
            UniqueName="StatusTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="SeverityTypeId" DataType="System.Int32"
            HeaderText="SeverityTypeId" SortExpression="SeverityTypeId"
            UniqueName="SeverityTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ProjectId" DataType="System.Int32"
            HeaderText="ProjectId" SortExpression="ProjectId" UniqueName="ProjectId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReportedById" DataType="System.Int32"
            HeaderText="ReportedById" SortExpression="ReportedById"
            UniqueName="ReportedById">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="AssignedToId" DataType="System.Int32"
            HeaderText="AssignedToId" SortExpression="AssignedToId"
            UniqueName="AssignedToId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="WorkflowStepId" DataType="System.Int32"
            HeaderText="WorkflowStepId" SortExpression="WorkflowStepId"
            UniqueName="WorkflowStepId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReportedByCustomerContactId"
            DataType="System.Int32" HeaderText="ReportedByCustomerContactId"
            SortExpression="ReportedByCustomerContactId"
            UniqueName="ReportedByCustomerContactId">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="PubliclyViewable"
            DataType="System.Boolean" HeaderText="PubliclyViewable"
            SortExpression="PubliclyViewable" UniqueName="PubliclyViewable">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="ReportedDate" DataType="System.DateTime"
            HeaderText="ReportedDate" SortExpression="ReportedDate"
            UniqueName="ReportedDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime"
            HeaderText="StartDate" SortExpression="StartDate" UniqueName="StartDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DueDate" DataType="System.DateTime"
            HeaderText="DueDate" SortExpression="DueDate" UniqueName="DueDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CompletionDate" DataType="System.DateTime"
            HeaderText="CompletionDate" SortExpression="CompletionDate"
            UniqueName="CompletionDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActualDuration" DataType="System.Single"
            HeaderText="ActualDuration" SortExpression="ActualDuration"
            UniqueName="ActualDuration">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActualUnitTypeId" DataType="System.Int32"
            HeaderText="ActualUnitTypeId" SortExpression="ActualUnitTypeId"
            UniqueName="ActualUnitTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EstimatedDuration" DataType="System.Single"
            HeaderText="EstimatedDuration" SortExpression="EstimatedDuration"
            UniqueName="EstimatedDuration">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DurationUnitTypeId" DataType="System.Int32"
            HeaderText="DurationUnitTypeId" SortExpression="DurationUnitTypeId"
            UniqueName="DurationUnitTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PercentComplete" DataType="System.Byte"
            HeaderText="PercentComplete" SortExpression="PercentComplete"
            UniqueName="PercentComplete">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EscalationLevelId" DataType="System.Int32"
            HeaderText="EscalationLevelId" SortExpression="EscalationLevelId"
            UniqueName="EscalationLevelId">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="Archived" DataType="System.Boolean"
            HeaderText="Archived" SortExpression="Archived" UniqueName="Archived">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="CreatedDateTime" DataType="System.DateTime"
            HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
            UniqueName="CreatedDateTime">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CreatedById" DataType="System.Int32"
            HeaderText="CreatedById" SortExpression="CreatedById" UniqueName="CreatedById">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastUpdatedDateTime"
            DataType="System.DateTime" HeaderText="LastUpdatedDateTime"
            SortExpression="LastUpdatedDateTime" UniqueName="LastUpdatedDateTime">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastUpdatedById" DataType="System.Int32"
            HeaderText="LastUpdatedById" SortExpression="LastUpdatedById"
            UniqueName="LastUpdatedById">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="RemainingDuration" DataType="System.Single"
            HeaderText="RemainingDuration" SortExpression="RemainingDuration"
            UniqueName="RemainingDuration">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="RemainingUnitTypeId"
            DataType="System.Int32" HeaderText="RemainingUnitTypeId"
            SortExpression="RemainingUnitTypeId" UniqueName="RemainingUnitTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReleaseId" DataType="System.Int32"
            HeaderText="ReleaseId" SortExpression="ReleaseId" UniqueName="ReleaseId">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
        SelectCommand="select * from incidents where incidentid >1500">
    </asp:SqlDataSource>
    </form>
</body>
</html>

6 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 15 Jul 2010, 02:01 PM
Hello Patrick,

To support data operations like data editing, paging, filtering and sorting, you need to setup advanced databinding (using the NeedDataSource event) for RadGrid. In your case, all the code in the DefineGridStructure() method should go inside the NeedDataSource event handler. You should also remove the call to Databind() as the latter should not be called when using advanced grid binding. Finally, note that you have set AllowAutomaticUpdates="true" for RadGrid1. Automatic updates/inserts/deletes work only with declarative data source controls. In your case, you are binding the grid manually in the NeedDataSource event handler. You should also implement your own update logic inside the UpdateCommand event handler.

Regards,
Veli
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Patrick
Top achievements
Rank 1
answered on 15 Jul 2010, 03:59 PM
The grid is still NOT WORKING  any  data/entry   ie: cannot type into the  column(s) 6 or 7

I set automaticupdates to false
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
 
    </div>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"  Width = "817px"
  AllowAutomaticUpdates="False"
     Height="341px"  MasterTableView-CanRetrieveAllData ="true"
      MasterTableView-Visible ="true" onneeddatasource="RadGrid1_NeedDataSource" onupdatecommand="RadGrid1_UpdateCommand"
        >
        <%--   DataKeyNames="IncidentId" AllowAutomaticUpdates="True"      --%>
<MasterTableView>
<RowIndicatorColumn>
</RowIndicatorColumn>
<%-- HeaderStyle Width="50px"/HeaderStyle-- %>
<%--was 30px--%>
<ExpandCollapseColumn>
 
</ExpandCollapseColumn>
<%-- HeaderStyle Width="50px"/HeaderStyle --%>
<%--was 30px--%>
    <Columns>
        <telerik:GridBoundColumn DataField="IncidentNumber" HeaderText="Incident #"
            ReadOnly="True"
            UniqueName="column"
            >
        </telerik:GridBoundColumn>
 
<%--                     ItemStyle-Width="110px" >--%>
 
        <telerik:GridBoundColumn DataField="Name" HeaderText="Subject"
            UniqueName="column1">
        </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Reported" HeaderText="Reported"
                ReadOnly="true"
           UniqueName="column2">
        </telerik:GridBoundColumn>
<%--             ItemStyle-Width="456px" --%>
        <telerik:GridBoundColumn DataField="IncidentDesc"
        ReadOnly="true"      HeaderText="Description"
        UniqueName="column3"  >
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn
        DataField="Flow" HeaderText="Flow"
        Readonly="true"
        UniqueName="column4"
        >
         </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActualDuration" DataType="System.Decimal"
            DefaultInsertValue="0.00" HeaderText="Actual Duration" Resizable="False"
             EmptyDataText = "0.00"
            UniqueName="column6">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn
        datafield="workDescr" HeaderText="Work Performed"
        uniquename="column7"
        ></telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
    </telerik:RadGrid>
    <telerik:RadGrid ID="RadGrid2" runat="server" GridLines="None"
        style="margin-top: 27px">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="IncidentId">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="IncidentId" DataType="System.Int32"
            HeaderText="IncidentId" ReadOnly="True" SortExpression="IncidentId"
            UniqueName="IncidentId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="IncidentNumber" HeaderText="IncidentNumber"
            SortExpression="IncidentNumber" UniqueName="IncidentNumber">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name" HeaderText="Name"
            SortExpression="Name" UniqueName="Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description" HeaderText="Description"
            SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReplicationProcedures"
            HeaderText="ReplicationProcedures" SortExpression="ReplicationProcedures"
            UniqueName="ReplicationProcedures">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Resolution" HeaderText="Resolution"
            SortExpression="Resolution" UniqueName="Resolution">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Notes" HeaderText="Notes"
            SortExpression="Notes" UniqueName="Notes">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PriorityTypeId" DataType="System.Int32"
            HeaderText="PriorityTypeId" SortExpression="PriorityTypeId"
            UniqueName="PriorityTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="StatusTypeId" DataType="System.Int32"
            HeaderText="StatusTypeId" SortExpression="StatusTypeId"
            UniqueName="StatusTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="SeverityTypeId" DataType="System.Int32"
            HeaderText="SeverityTypeId" SortExpression="SeverityTypeId"
            UniqueName="SeverityTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ProjectId" DataType="System.Int32"
            HeaderText="ProjectId" SortExpression="ProjectId" UniqueName="ProjectId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReportedById" DataType="System.Int32"
            HeaderText="ReportedById" SortExpression="ReportedById"
            UniqueName="ReportedById">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="AssignedToId" DataType="System.Int32"
            HeaderText="AssignedToId" SortExpression="AssignedToId"
            UniqueName="AssignedToId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="WorkflowStepId" DataType="System.Int32"
            HeaderText="WorkflowStepId" SortExpression="WorkflowStepId"
            UniqueName="WorkflowStepId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReportedByCustomerContactId"
            DataType="System.Int32" HeaderText="ReportedByCustomerContactId"
            SortExpression="ReportedByCustomerContactId"
            UniqueName="ReportedByCustomerContactId">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="PubliclyViewable"
            DataType="System.Boolean" HeaderText="PubliclyViewable"
            SortExpression="PubliclyViewable" UniqueName="PubliclyViewable">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="ReportedDate" DataType="System.DateTime"
            HeaderText="ReportedDate" SortExpression="ReportedDate"
            UniqueName="ReportedDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime"
            HeaderText="StartDate" SortExpression="StartDate" UniqueName="StartDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DueDate" DataType="System.DateTime"
            HeaderText="DueDate" SortExpression="DueDate" UniqueName="DueDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CompletionDate" DataType="System.DateTime"
            HeaderText="CompletionDate" SortExpression="CompletionDate"
            UniqueName="CompletionDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActualDuration" DataType="System.Single"
            HeaderText="ActualDuration" SortExpression="ActualDuration"
            UniqueName="ActualDuration">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActualUnitTypeId" DataType="System.Int32"
            HeaderText="ActualUnitTypeId" SortExpression="ActualUnitTypeId"
            UniqueName="ActualUnitTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EstimatedDuration" DataType="System.Single"
            HeaderText="EstimatedDuration" SortExpression="EstimatedDuration"
            UniqueName="EstimatedDuration">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DurationUnitTypeId" DataType="System.Int32"
            HeaderText="DurationUnitTypeId" SortExpression="DurationUnitTypeId"
            UniqueName="DurationUnitTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PercentComplete" DataType="System.Byte"
            HeaderText="PercentComplete" SortExpression="PercentComplete"
            UniqueName="PercentComplete">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EscalationLevelId" DataType="System.Int32"
            HeaderText="EscalationLevelId" SortExpression="EscalationLevelId"
            UniqueName="EscalationLevelId">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="Archived" DataType="System.Boolean"
            HeaderText="Archived" SortExpression="Archived" UniqueName="Archived">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="CreatedDateTime" DataType="System.DateTime"
            HeaderText="CreatedDateTime" SortExpression="CreatedDateTime"
            UniqueName="CreatedDateTime">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CreatedById" DataType="System.Int32"
            HeaderText="CreatedById" SortExpression="CreatedById" UniqueName="CreatedById">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastUpdatedDateTime"
            DataType="System.DateTime" HeaderText="LastUpdatedDateTime"
            SortExpression="LastUpdatedDateTime" UniqueName="LastUpdatedDateTime">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastUpdatedById" DataType="System.Int32"
            HeaderText="LastUpdatedById" SortExpression="LastUpdatedById"
            UniqueName="LastUpdatedById">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="RemainingDuration" DataType="System.Single"
            HeaderText="RemainingDuration" SortExpression="RemainingDuration"
            UniqueName="RemainingDuration">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="RemainingUnitTypeId"
            DataType="System.Int32" HeaderText="RemainingUnitTypeId"
            SortExpression="RemainingUnitTypeId" UniqueName="RemainingUnitTypeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReleaseId" DataType="System.Int32"
            HeaderText="ReleaseId" SortExpression="ReleaseId" UniqueName="ReleaseId">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
        SelectCommand="select * from incidents where incidentid >1500">
    </asp:SqlDataSource>
    </form>
</body>
</html>
 and the code from define grid structure was moved into NeedDataSource
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
 
public partial class Default : System.Web.UI.Page
{
   
    protected void Page_Init(object sender, System.EventArgs e)
    {
//        DefineGridStructure(); // this method will populate  this  RadGrid1.
    }
    private void DefineGridStructure()
    {
    }
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        // taken from Define Grid Structure
       // populate  this  RadGrid1.
        string sqlCxn = "Data Source=DESQL2008;Initial Catalog=DrawOnTime;User Id=ontimeweb;Password=ontime1234;", sql2008;
        sql2008 = "select IncidentId, IncidentNumber, Incidents.Name, " +
        " CASE " +
        " WHEN DATEPART (YYYY,ReportedDate)=1899 THEN '  /  /   '" +
        " ELSE" +
        " CONVERT (char(8),ReportedDate,1)" +
        " END " +
        " as Reported," +
        " Substring(Incidents.Description,1,32)+'\n'+" +
        " Substring(Incidents.Description,33,32)+'\n'+" +
        " Substring(Incidents.Description,65,32)+'\n'+" +
        " Substring(Incidents.Description,97,32) as IncidentDesc," +
         "Users.FirstName + ' '+" +
        "Users.LastName as 'IT Employee Assigned', WorkFlowSteps.StepName as Flow," +
        "000.00 as nLabor, space(40) as workDescr" +
        " from incidents " +
        "left join WorkFlowSteps on Incidents.WorkFlowStepId = WorkFlowSteps.WorkFlowStepId " +
        "left join WorkLog on IncidentId = ItemId " +
        " left join Users on Users.UserId=Incidents.AssignedToId " +
        " where (WorkLogId is null and Left(WorkFlowSteps.StepName,6) <>'Closed' and Left(WorkFlowSteps.StepName,3) <>'UAT' and " +
        "Left(WorkFlowSteps.StepName,4)<>'Hold' ) and " +
        " ( AssignedToId=0 or AssignedToId = @UID ) ";
 
        SqlConnection dbconn = new SqlConnection(sqlCxn), dbconn2;
        dbconn2 = new SqlConnection(sqlCxn);
        dbconn.Open();
        dbconn2.Open();
 
        SqlCommand myCommand = new SqlCommand(sql2008, dbconn), mycommand2;
        mycommand2 = new SqlCommand(sql2008, dbconn2);
         
        SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand), myAdapter2;
        myAdapter2 = new SqlDataAdapter(mycommand2);
 
        DataSet ds = new DataSet(), ds2;
        ds2 = new DataSet();
 
        myCommand.Parameters.AddWithValue("UID", 5);       //Default.UID);
        myAdapter.Fill(ds);
//        if (ds.Tables[0].Rows.Count == 0)
           //            this.btnSubmit.Visible = false; //           .Enabled = false;
         
        mycommand2.Parameters.AddWithValue("UID", 5);
        myAdapter2.Fill(ds2);
 
        RadGrid1.DataSource = ds;
// need Advanced Data Binding         RadGrid1.DataBind();
/*
        RadGrid2.DataSource = ds2;
        RadGrid2.DataBind();
        */
        RadGrid2.Visible = false;
 
 
 
//        RadGrid1.Visible = true;
  
    }
 
    protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
    {
        // go thru the RadGrid and then  perform update commands
    }
}
0
Veli
Telerik team
answered on 19 Jul 2010, 11:10 AM
Hi Patrick,

Do you get any javascript errors? Not being able to type any text in the textboxes generated for column6 and 7 indicate some client-side problems. The GridBoundColumn renders regular TextBox controls in the edit form, so no scripts should be interfering by default.

Regards,
Veli
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Patrick
Top achievements
Rank 1
answered on 19 Jul 2010, 02:10 PM
no there are no JavaScript Errors  -- i do not use Java.
0
Veli
Telerik team
answered on 19 Jul 2010, 02:29 PM
Hello Patrick,

To be able to identify the cause for this issue and assist you further, we need to be able to reproduce this issue. Consider opening a regular support ticket where you can send us some stripped down runnable project we can test locally.

Regards,
Veli
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Patrick
Top achievements
Rank 1
answered on 19 Jul 2010, 02:53 PM
we could not develop  grids
When we tried during the first 30 days  of development.
So we had NOT IMPLEMENT TELERIK  to DEVELOP WEB SOFTWARE.

We SHOULD NOT have to  PAY $upport.

When in  fact we were never able to  USE TELERIK SOFTWARE
Tags
Grid
Asked by
Patrick
Top achievements
Rank 1
Answers by
Veli
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or