I'm trying to do a couple of things (picture attached):
1. Remove the empty white row that shows up when there are no records. How can I get rid of it?
2. Right below the textbox to insert a new item, there is a double line. Like the border is thicker. How can I remove the thicker border and just have a normal border at the bottom?
Here's my code:
<
telerik:RadGrid
ID
=
"rgImpacts"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"False"
AllowAutomaticUpdates
=
"True"
AllowSorting
=
"True"
CellSpacing
=
"0"
DataSourceID
=
"odsImpacts"
GridLines
=
"None"
Width
=
"800px"
AutoGenerateColumns
=
"False"
OnInsertCommand
=
"rgImpacts_InsertCommand"
>
<
AlternatingItemStyle
BackColor
=
"White"
/>
<
MasterTableView
CommandItemDisplay
=
"None"
DataKeyNames
=
"idImpactId"
DataSourceID
=
"odsImpacts"
EditMode
=
"InPlace"
InsertItemDisplay
=
"Bottom"
ShowHeader
=
"False"
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"varcharImpact"
FilterControlAltText
=
"Filter varcharImpact column"
HeaderText
=
"Impact"
SortExpression
=
"varcharImpact"
UniqueName
=
"varcharImpact"
>
<
EditItemTemplate
>
<
telerik:RadTextBox
ID
=
"txtImpact"
runat
=
"server"
Text='<%# Bind("varcharImpact") %>' MaxLength="100" Width="600px" />
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblImpact"
runat
=
"server"
Text='<%# Eval("varcharImpact") %>'></
asp:Label
>
</
ItemTemplate
>
<
HeaderStyle
Width
=
"650px"
></
HeaderStyle
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
Groupable
=
"False"
UniqueName
=
"EditCommandColumn"
>
<
EditItemTemplate
>
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
CssClass
=
"gridLink"
CommandName
=
"Update"
Text
=
"Update"
/>
<
asp:LinkButton
ID
=
"LinkButton2"
runat
=
"server"
CssClass
=
"gridLink"
CausesValidation
=
"false"
CommandName
=
"Cancel"
Text
=
"Cancel"
/>
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"LinkButton4"
runat
=
"server"
CssClass
=
"gridLink"
CausesValidation
=
"false"
CommandName
=
"Edit"
Text
=
"Edit"
/>
<
asp:LinkButton
ID
=
"LinkButton3"
runat
=
"server"
CssClass
=
"gridLink"
CausesValidation
=
"false"
CommandName
=
"Delete"
Text
=
"Delete"
/>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
asp:LinkButton
ID
=
"LinkButton5"
runat
=
"server"
CssClass
=
"gridLink"
CommandName
=
"PerformInsert"
Text
=
"Insert"
/>
</
InsertItemTemplate
>
<
HeaderStyle
Width
=
"100px"
></
HeaderStyle
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
ButtonType
=
"ImageButton"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
public partial class ChangeRequestForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
rgImpacts.MasterTableView.NoMasterRecordsText = string.Empty;
rgImpacts.MasterTableView.NoDetailRecordsText = string.Empty;
rgImpacts.MasterTableView.IsItemInserted = true;
rgImpacts.Rebind();
}
}
protected void rgImpacts_InsertCommand(object sender, GridCommandEventArgs e)
{
GridEditableItem item = e.Item as GridDataItem;
if (item != null)
{
var varcharImpact = ((RadTextBox) item.FindControl("txtImpact")).Text;
DataAccessLayer.Impacts.ImpactsInsert(varcharImpact);
rgImpacts.Rebind();
e.Canceled = true;
}
}
}