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

[Solved] Hide GridButtonColumn

5 Answers 417 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brendan
Top achievements
Rank 1
Brendan asked on 06 Jul 2009, 06:43 PM
To whom it may concern;

I have the following RadGrid in my page.  If I want to hide the edit and delete column when data isMatched = true, how to implement it?

thank you in advance for your help.

Brendan

 

<telerik:RadGrid ID="CTADailyReConList" runat="server" GridLines="None" ShowStatusBar="true"

 

 

AllowAutomaticDeletes="True"

 

 

onupdatecommand="CTADailyReConList_UpdateCommand"

 

 

onitemdatabound="CTADailyReConList_ItemDataBound"

 

 

oninsertcommand="CTADailyReConList_InsertCommand"

 

 

onneeddatasource="CTADailyReConList_NeedDataSource"

 

 

ondeletecommand="CTADailyReConList_DeleteCommand" >

 

 

<ExportSettings>

 

 

<Excel Format="Html" />

 

 

</ExportSettings>

 

 

<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="CTADailyReCapID" >

 

 

<Columns>

 

 

<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Edit" Text="Edit"

 

 

UniqueName="EditColumn">

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridButtonColumn>

 

 

<telerik:GridBoundColumn DataField="CTADailyReCapID" DataType="System.Int32" Visible = "false" ReadOnly="true" UniqueName="CTADailyReCapID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CTAImportFileID" DataType="System.Int32" Visible = "false" ReadOnly="true" UniqueName="CTAImportFileID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TradeDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}"

 

 

HeaderText="Trade Date" SortExpression="TradeDate" UniqueName="TradeDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn DataField="AccountNumber"

 

 

HeaderText="AccountNumber" SortExpression="AccountNumber" UniqueName="AccountNumber">

 

 

<EditItemTemplate>

 

 

<asp:DropDownList ID="drpAccount" runat="server"></asp:DropDownList>

 

 

</EditItemTemplate>

 

 

<ItemTemplate>

 

 

<asp:Label runat="server" ID="lblAccountNumber" Text='<%# Eval("AccountNumber") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="BuySellCode" HeaderText="Buy/Sell"

 

 

SortExpression="BuySellCode" UniqueName="BuySellCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Quantity" DataType="System.Decimal"

 

 

HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FCMInstrument" HeaderText="FCM Instrument" ReadOnly= "true"

 

 

SortExpression="FCMInstrument" UniqueName="FCMInstrument">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Price" DataType="System.Decimal"

 

 

HeaderText="Price" SortExpression="Price" UniqueName="Price">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PromptYear" DataType="System.Int32"

 

 

HeaderText="Year" SortExpression="PromptYear" UniqueName="PromptYear">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PromptMonth" DataType="System.Int32"

 

 

HeaderText="Month" SortExpression="PromptMonth" UniqueName="PromptMonth">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PromptDay" DataType="System.Int32" Visible = "false" ReadOnly = "true"

 

 

HeaderText="PromptDay" SortExpression="PromptDay" UniqueName="PromptDay">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ClearingBroker" DataType="System.Int32" Visible = "false" ReadOnly = "true"

 

 

HeaderText="ClearingBroker" SortExpression="ClearingBroker"

 

 

UniqueName="ClearingBroker">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TransactionType" Visible = "false" ReadOnly = "true"

 

 

HeaderText="TransactionType" SortExpression="TransactionType"

 

 

UniqueName="TransactionType">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TradeID" HeaderText="TradeID" Visible = "false"

 

 

SortExpression="TradeID" UniqueName="TradeID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Exchange" HeaderText="Exchange" Visible = "false"

 

 

SortExpression="Exchange" UniqueName="Exchange">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ExecutingBroker" Visible = "false"

 

 

HeaderText="ExecutingBroker" SortExpression="ExecutingBroker"

 

 

UniqueName="ExecutingBroker">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Instrument" HeaderText="Instrument"

 

 

SortExpression="Instrument" UniqueName="Instrument">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="PricingSystem" HeaderText="PricingSystem" Visible = "false" ReadOnly = "true"

 

 

SortExpression="PricingSystem" UniqueName="PricingSystem">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TradeType" HeaderText="TradeType" Visible = "false" ReadOnly = "true"

 

 

SortExpression="TradeType" UniqueName="TradeType">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn DataField="IsMatched" DataType="System.Boolean" ReadOnly = "true"

 

 

HeaderText="IsMatched" SortExpression="IsMatched" UniqueName="IsMatched">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridCheckBoxColumn DataField="OnHold" DataType="System.Boolean" Visible = "false" ReadOnly = "true"

 

 

HeaderText="OnHold" SortExpression="OnHold" UniqueName="OnHold">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridBoundColumn DataField="UpdateDate" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="UpdateDate" SortExpression="UpdateDate" UniqueName="UpdateDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="UpdateUser" HeaderText="UpdateUser" Visible = "false" ReadOnly = "true"

 

 

SortExpression="UpdateUser" UniqueName="UpdateUser">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Comment" HeaderText="Comment"

 

 

SortExpression="Comment" UniqueName="Comment">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CashAdjustment" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="CashAdjustment" SortExpression="CashAdjustment"

 

 

UniqueName="CashAdjustment">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Adjustment300120" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="Adjustment300120" SortExpression="Adjustment300120"

 

 

UniqueName="Adjustment300120">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Adjustment300120Cash" Visible = "false" ReadOnly = "true"

 

 

DataType="System.Decimal" HeaderText="Adjustment300120Cash"

 

 

SortExpression="Adjustment300120Cash" UniqueName="Adjustment300120Cash">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Market" HeaderText="Market" Visible = "false" ReadOnly = "true"

 

 

SortExpression="Market" UniqueName="Market">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ContractCode" HeaderText="ContractCode" Visible = "false" ReadOnly = "true"

 

 

SortExpression="ContractCode" UniqueName="ContractCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TimeStamp" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="TimeStamp" SortExpression="TimeStamp" UniqueName="TimeStamp">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CurrencyCode" HeaderText="CurrencyCode" Visible = "false" ReadOnly = "true"

 

 

SortExpression="CurrencyCode" UniqueName="CurrencyCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="SettlementDate" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="SettlementDate" SortExpression="SettlementDate"

 

 

UniqueName="SettlementDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="EffectiveDate" DataType="System.DateTime" Visible = "false" ReadOnly = "true"

 

 

HeaderText="EffectiveDate" SortExpression="EffectiveDate"

 

 

UniqueName="EffectiveDate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Commission" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="Commission" SortExpression="Commission" UniqueName="Commission">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CounterParty" HeaderText="CounterParty" Visible = "false" ReadOnly = "true"

 

 

SortExpression="CounterParty" UniqueName="CounterParty">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FullPointValue" DataType="System.Decimal" Visible = "false" ReadOnly = "true"

 

 

HeaderText="FullPointValue" SortExpression="FullPointValue"

 

 

UniqueName="FullPointValue">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="InstrumentCode" HeaderText="InstrumentCode" Visible = "false" ReadOnly = "true"

 

 

SortExpression="InstrumentCode" UniqueName="InstrumentCode">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridButtonColumn ConfirmText="Delete this trade?" ConfirmDialogType="RadWindow"

 

 

ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"

 

 

UniqueName="DeleteColumn">

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridButtonColumn>

 

 

</Columns>

 

 

<EditFormSettings ColumnNumber="3" CaptionFormatString="Edit details" >

 

 

<FormTableItemStyle Wrap="False"></FormTableItemStyle>

 

 

<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>

 

 

<FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%" />

 

 

<FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" Width="100%" />

 

 

<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>

 

 

<FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>

 

 

<EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">

 

 

</EditColumn>

 

 

<FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 06 Jul 2009, 09:03 PM
Hello Brendan,

Could you please try the following approach?
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    if (e.Item is GridDataItem) 
    { 
        GridDataItem item = e.Item as GridDataItem; 
        if ((bool)DataBinder.Eval(item.DataItem, "IsMatched")) 
        { 
            item["EditColumn"].Controls[0].Visible = false
            item["DeleteColumn"].Controls[0].Visible = false
        } 
    } 

I recommend you also add &nbsp; to the cells to avoid browser issues with missing borders:
item["EditColumn"].Text = "&nbsp;"
item["DeleteColumn"].Text = "&nbsp;"

Let us know whether this helps.

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Brendan
Top achievements
Rank 1
answered on 03 Mar 2010, 03:31 PM

Is there any functionality which inserts records from the clipboard content of Excel into Database table.  

 

Like ctrl+C on excel creates a copy in clipboard. Clicking Paste(BUTTON IN GUI) should PARSE the clipboard data into rows and columns and insert into database table. Display RadGrid bound along with the inserted data. Please let me know if this functionality can be done in a simpler way.
0
Daniel
Telerik team
answered on 04 Mar 2010, 10:00 PM
Hi Brendan,

Please download the attached demo and let me know whether this approach is suitable for you.

Sincerely yours,
Daniel
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
Brendan
Top achievements
Rank 1
answered on 05 Mar 2010, 10:01 PM
Onclick Paste Button
Microsoft JScript runtime error: 'rows.length' is null or not an object
Microsoft JScript runtime error: 'cells.length' is null or not an object

Clipboard data not pasting into the grid.

When node in radtreeview is clicked Radgrid bound to the corresponding data is displayed. 
To insert bulk data from excel I copy from excel and OnClick Paste Button the grid should show the pasted data. The solution given is doing somthing similar but not working in my application. Could you reply me with the changes to be done to work properly.


<

 

telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowFilteringByColumn="True" AllowSorting="True" PageSize="20" Skin="WebBlue"

 

 

 

AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AutoGenerateColumns="False" DataSourceID="SessionDataSource1" OnPageIndexChanged="PageIndexChanged" AllowPaging="true"

 

 

 

OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_OnItemDataBound" AllowMultiRowEdit="true" onclick="gridFocus(event)" >

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

 

<MasterTableView EditMode="InPlace" Width="100%" CommandItemDisplay="Top" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"

 

 

 

HorizontalAlign="NotSet" InsertItemPageIndexAction="ShowItemOnFirstPage" CommandItemStyle-Wrap="false" datasourceid="SessionDataSource1" DataKeyNames="Date" TableLayout="Fixed" >

 

 

 

 

<Columns>

 

 

 

<telerik:GridDateTimeColumn DataField="Date" DataType="System.DateTime" DataFormatString="{0:MMM-yyyy}" HeaderText="Date" SortExpression="Date"

 

 

 

UniqueName="Date" ShowSortIcon="true" PickerType="DatePicker">

 

 

 

</telerik:GridDateTimeColumn>

 

 

 

<telerik:GridNumericColumn DataField="ROR" NumericType="Percent" HeaderText="ROR" UniqueName="ROR" SortExpression="ROR"></telerik:GridNumericColumn>

 

 

 

<telerik:GridNumericColumn DataField="Assets" NumericType="Currency" DataFormatString="{0:$##,###,###}" HeaderText="Assets" SortExpression="Assets" UniqueName="Assets"></telerik:GridNumericColumn>

 

 

 

<telerik:GridCheckBoxColumn DataField="Estimate" DataType ="System.Boolean" HeaderText="Estimate" SortExpression="Estimate" UniqueName="Estimate" >

 

 

 

</telerik:GridCheckBoxColumn>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" >

 

 

 

<ItemStyle CssClass="MyImageButton" />

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

</Columns>

 

 

 

 

<CommandItemTemplate>

 

 

 

<div style="float: left">

 

 

 

<input type="button" value="Paste" onclick="pasteFromExcel()" />

 

 

 

<input type="button" value="Clear cells" onclick="clearCells()" />

 

 

 

<asp:Button ID="UpdateEditedButton" CommandName="EditAll" Text="Edit & Save" runat="server" />

 

 

 

<asp:Button ID="ExcelExport" runat="server" Text="ExporttoExcel" OnClick="Button1_Click" />

 

 

 

</div>

 

 

 

</CommandItemTemplate>

 

 

 

 

<EditFormSettings>

 

 

 

<EditColumn UniqueName="EditCommandColumn1" ></EditColumn>

 

 

 

</EditFormSettings>

 

 

 

<CommandItemStyle Wrap="false"></CommandItemStyle>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

</telerik:RadAjaxPanel>

 

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

 

ConnectionString="<%$ ConnectionStrings:Grapevine_NewConnectionString3 %>"

 

 

 

SelectCommand="SELECT [ProgID], [ProgName], [MgrID] FROM [MgrProg_4] WHERE [ShareLevel]=0 ORDER BY [ProgName]">

 

 

 

</asp:SqlDataSource>

 

 

 

 

<asp:SqlDataSource ID="SqlDataSource2" runat="server"

 

 

 

ConnectionString="<%$ ConnectionStrings:Grapevine_NewConnectionString3 %>"

 

 

 

SelectCommand="SELECT [ProgID], [ProgName], [MgrID] FROM [MgrProg_4] WHERE [ShareLevel]=1 ORDER BY [ProgName]">

 

 

 

</asp:SqlDataSource>

 

 

 

 

<asp:SqlDataSource ID="SessionDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Grapevine_NewConnectionString6 %>"

 

 

 

SelectCommand="SELECT MonthlyPerformance.Date, MonthlyPerformance.ROR, MonthlyPerformance.Assets, MonthlyPerformance.Estimate FROM MonthlyPerformance INNER JOIN Program ON MonthlyPerformance.ProgID = Program.ProgID WHERE (Program.ProgName = @ProgName) ORDER BY MonthlyPerformance.Date DESC"

 

 

 

OnSelecting="SessionDataSource1_OnSelecting" InsertCommand="sp_Monthly_Insert" InsertCommandType="StoredProcedure" OnInserting="SessionDataSource1_OnInserting" OnUpdating="SessionDataSource1_OnUpdating"

 

 

 

UpdateCommand="UPDATE MonthlyPerformance SET ROR = CAST(@ROR as decimal(9,4)), Assets = CAST(@Assets AS money), Estimate = CAST(@Estimate AS bit) WHERE (ProgID = (SELECT ProgID FROM Program WHERE (ProgName = @ProgName))) AND (Date = CONVERT (DATETIME, @original_Date, 101)) AND (ROR = @original_ROR) AND (Assets = @original_Assets) AND (Estimate = @original_Estimate)"

 

 

 

OldValuesParameterFormatString="original_{0}"

 

 

 

ConflictDetection="CompareAllValues" >

 

 

 

<SelectParameters>

 

 

 

<asp:Parameter Name="ProgName" Type="String" />

 

 

 

</SelectParameters>

 

 

 

<UpdateParameters>

 

 

 

<asp:Parameter Name="ROR" />

 

 

 

<asp:Parameter Name="Assets" Type="Int32" />

 

 

 

<asp:Parameter Name="Estimate" />

 

 

 

<asp:Parameter Name="ProgName" Type="String" />

 

 

 

<asp:Parameter Name="original_Date" Type="DateTime" />

 

 

 

<asp:Parameter Name="original_ROR" />

 

 

 

<asp:Parameter Name="original_Assets" />

 

 

 

<asp:Parameter Name="original_Estimate" />

 

 

 

</UpdateParameters>

 

 

 

<InsertParameters>

 

 

 

<asp:Parameter Name="ProgName" Type="String" />

 

 

 

<asp:Parameter Name="Date" Type="DateTime" />

 

 

 

<asp:Parameter Name="ROR" Type="Decimal" />

 

 

 

<asp:Parameter Name="Assets" Type="Decimal" />

 

 

 

<asp:Parameter Name="Estimate" Type="Boolean" />

 

 

 

</InsertParameters>

 

 

 

</asp:SqlDataSource>

 

function

 

pasteFromExcel()

 

{

 

if (!lastFocused) return;

 

 

var clipData = window.clipboardData.getData('Text');

 

 

var crlf = String.fromCharCode(13) + String.fromCharCode(10);

 

 

var table = clipData.split(crlf);

 

 

for (var tRow = 0; tRow < table.length - 1; tRow++)

 

table[tRow] = table[tRow].split(String.fromCharCode(9));

Array.remove(table, table[table.length - 1]);

fillTable(table);

}

 

function fillTable(table)

 

{

 

var pCell = lastFocused.parentNode;

 

 

var pRow = pCell.parentNode;

 

 

var pBody = pRow.parentNode;

 

 

var maxRows = pBody.rows.length;

 

 

var maxCols = pRow.cells.length;

 

 

for (var row = 0; row < table.length; row++)

 

{

 

for (var col = 0; col < table[row].length; col++)

 

{

 

var cCellIndex = pCell.cellIndex + col;

 

 

var cRowIndex = pRow.sectionRowIndex + row;

 

 

if (cRowIndex < maxRows && cCellIndex < maxCols)

 

{

 

var cCell = pBody.rows[cRowIndex].cells[cCellIndex];

 

 

var pInput = cCell.getElementsByTagName("input")[0];

 

pInput.style.backgroundColor =

"#F7FAFF";

 

pInput.value = table[row][col];

}

}

}

}

 

function gridFocus(e)

 

{

e = e || window.event;

 

var target = e.target || e.srcElement;

 

 

if (target.tagName.toLowerCase() == "input" && target.type.toLowerCase() == "text")

 

lastFocused = target;

}

 

function clearCells(sender)

 

{

 

var radGrid = $get('<%= RadGrid1.ClientID %>');

 

 

var inputs = radGrid.getElementsByTagName("input");

 

 

for (var el = 0; el < inputs.length; el++)

 

{

 

if (inputs[el].type == "text")

 

{

inputs[el].value =

"";

 

inputs[el].style.backgroundColor =

"";

 

}

}

}

 

 

 


C#::

using

 

System;

 

 

using

 

System.Collections.Generic;

 

 

using

 

System.Linq;

 

 

using

 

System.Web;

 

 

using

 

System.Web.UI;

 

 

using

 

System.Web.UI.WebControls;

 

 

using

 

Telerik.Web.UI;

 

 

using

 

System.Data;

 

 

using

 

System.Data.SqlClient;

 

 

using

 

System.Configuration;

 

 

using

 

System.Data.OleDb;

 

 

using

 

System.IO;

 

 

using

 

System.Windows.Forms;

 

 

using

 

System.Drawing;

 

 

using

 

System.Text;

 

 

using

 

System.ComponentModel;

 

 

using

 

System.Xml.Linq;

 

 

 

public

 

partial class MonthlyPerf : System.Web.UI.Page

 

 

{

 

static string nodeSelected;

 

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

}

 

 

 

protected void RadGrid1_OnItemDataBound(object sender, GridItemEventArgs e)

 

{

RadGrid1.MasterTableView.IsItemInserted =

 

true;

 

}

 

 

/* protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)

 

{

if (e.Column is GridBoundColumn)

e.Column.Visible = (e.Column as GridBoundColumn).DataField != "ID";

}

 

protected void RadGrid1_ItemUpdated(object source, GridUpdatedEventArgs e)

{

e.KeepInEditMode = true;

}

*/

 

 

protected void RadTreeView_OnNodeClick(object sender, RadTreeNodeEventArgs e)

 

{

RadTreeNode node = e.Node;

 

 

if (e.Node.ParentNode != null)

 

{

nodeSelected = node.Text;

RadGrid1.DataBind();

RadGrid1.MasterTableView.DataBind();

}

 

 

else

 

 

{

Response.Redirect(

"MainDefault.aspx");

 

nodeSelected = node.Text;

}

}

 

}

0
Daniel
Telerik team
answered on 11 Mar 2010, 10:26 PM
Hello Brendan,

The problem is that the columns other than GridBoundColumn use special editor (client-side component) instead of plain text box. The easiest way to sidestep these errors could be to change all editable columns to GridBoundColumn type. In theory, you could try to identify the control, but this will be a time consuming operation and will require an additional coding. Also, restraining the column types will restrain the data you could paste inside - e.g. Date, Numeric, Numeric, Boolean.

Best regards,
Daniel
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.
Tags
Grid
Asked by
Brendan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Brendan
Top achievements
Rank 1
Share this question
or