<
div
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
CellSpacing
=
"0"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
Width
=
"800px"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ProblemID"
DataSourceID
=
"SqlDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProblemID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ProblemID column"
HeaderText
=
"ProblemID"
ReadOnly
=
"True"
SortExpression
=
"ProblemID"
UniqueName
=
"ProblemID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
DataField
=
"DefectID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter DefectID column"
HeaderText
=
"DefectID"
SortExpression
=
"DefectID"
UniqueName
=
"DefectID"
>
<
EditItemTemplate
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
height
=
"200px"
width
=
"300px"
>
<
telerik:RadComboBox
ID
=
"DefectComboBox"
runat
=
"server"
AllowCustomText
=
"True"
AppendDataBoundItems
=
"True"
DataSourceID
=
"SqlDataSource2"
DataTextField
=
"Defect"
DataValueField
=
"DefectID"
Height
=
"150px"
HighlightTemplatedItems
=
"True"
SelectedValue='<%# Bind("DefectID") %>'
Skin="Windows7" Width="365px">
<
Items
>
<
telerik:RadComboBoxItem
Selected
=
"True"
Text
=
"[Not Defined]"
Value
=
""
Owner
=
"DefectComboBox"
/>
</
Items
>
<
WebServiceSettings
>
<
ODataSettings
InitialContainerName
=
""
>
</
ODataSettings
>
</
WebServiceSettings
>
<
HeaderTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
Runat
=
"server"
AutoPostBack
=
"True"
EmptyMessage
=
"add a new defect"
LabelWidth
=
""
Text='<%# Bind("Defect") %>'
Width="185px">
</
telerik:RadTextBox
>
<
telerik:RadButton
ID
=
"addDefect"
runat
=
"server"
Text
=
"Add"
>
<
Icon
PrimaryIconCssClass
=
"rbAdd"
/>
</
telerik:RadButton
>
</
HeaderTemplate
>
<
FooterTemplate
>
<
br
/>
</
FooterTemplate
>
</
telerik:RadComboBox
>
</
telerik:RadAjaxPanel
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Label
ID
=
"DefectIDLabel"
runat
=
"server"
Text='<%# Eval("DefectID") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProblemName"
FilterControlAltText
=
"Filter ProblemName column"
HeaderText
=
"ProblemName"
SortExpression
=
"ProblemName"
UniqueName
=
"ProblemName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProblemDescription"
FilterControlAltText
=
"Filter ProblemDescription column"
HeaderText
=
"ProblemDescription"
SortExpression
=
"ProblemDescription"
UniqueName
=
"ProblemDescription"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ProblemDate"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter ProblemDate column"
HeaderText
=
"ProblemDate"
SortExpression
=
"ProblemDate"
UniqueName
=
"ProblemDate"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
<
WebServiceSettings
>
<
ODataSettings
InitialContainerName
=
""
></
ODataSettings
>
</
WebServiceSettings
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
<
WebServiceSettings
>
<
ODataSettings
InitialContainerName
=
""
></
ODataSettings
>
</
WebServiceSettings
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Problems] WHERE [ProblemID] = @ProblemID"
InsertCommand="INSERT INTO [Problems] ([DefectID], [ProblemName], [ProblemDescription], [ProblemDate]) VALUES (@DefectID, @ProblemName, @ProblemDescription, @ProblemDate)"
SelectCommand="SELECT * FROM [Problems]"
UpdateCommand="UPDATE [Problems] SET [DefectID] = @DefectID, [ProblemName] = @ProblemName, [ProblemDescription] = @ProblemDescription, [ProblemDate] = @ProblemDate WHERE [ProblemID] = @ProblemID">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"ProblemID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"DefectID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"ProblemName"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ProblemDescription"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ProblemDate"
Type
=
"DateTime"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"DefectID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"ProblemName"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ProblemDescription"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ProblemDate"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"ProblemID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource2"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [DefectID], [Defect] FROM [Defects]">
</
asp:SqlDataSource
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
asp:SqlDataSource
ID
=
"SqlDataSource3"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Defects] WHERE [DefectID] = @DefectID"
InsertCommand="INSERT INTO [Defects] ([Defect]) VALUES (@Defect)"
SelectCommand="SELECT [DefectID], [Defect] FROM [Defects]"
UpdateCommand="UPDATE [Defects] SET [Defect] = @Defect WHERE [DefectID] = @DefectID">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"DefectID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"Defect"
Type
=
"String"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Defect"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"DefectID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
Runat
=
"server"
Skin
=
"Default"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
</
div
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web;
public
partial
class
PBM : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
//protected void addDefect_Click(object sender, EventArgs e)
//{
// DefectsTableAdapters.InsertDefectsTableAdapter instdfcts = new
// DefectsTableAdapters.InsertDefectsTableAdapter();
// int numRows = instdfcts.InsertDefects(RadTextBox1.Text);
//}
}
Hi telerik Team,
I have created HTML
dropdown and HTML input box as Additional fields for RADUpload, everything is
working fine but I want all of them in one row , please advise how can I
achieve it.
-----------------------------
function addTitle(radUpload, args) {
var curLiEl = args.get_row();
var firstInput = curLiEl.getElementsByTagName("input")[0];
//Create a simple HTML template.
var table = document.createElement("table");
table.className = 'AdditionalInputs';
//A new row for a Title field
row = table.insertRow(-1);
cell = row.insertCell(-1);
select = document.createElement("select");
select.name = "SubmissionType";
select.className = "DropDownList";
select.id = select.name = radUpload.getID(select.name);
var labelDocType = CreateLabel("Document Types: ", select.id);
cell.appendChild(labelDocType);
cell.appendChild(select);
addOption(select, "------- Select Document Type -------", "0");
bindDropDown(select);
input = CreateInput("SubmissionForm", "hidden");
input.name = "SubmissionForm";
input.id = input.name = radUpload.getID(input.name);
cell.appendChild(input);
select.onchange = function () { assignHiddenInput(); }; // Call function on Dropdown change event.
//A new row for a Title field
row = table.insertRow(-1);
cell = row.insertCell(-1);
var inputTitle = CreateInput("Title", "text");
inputTitle.className = "TextField";
inputTitle.id = inputTitle.name = radUpload.getID(inputTitle.name);
var label = CreateLabel("Notes about Documents if any: ", inputTitle.id);
cell.appendChild(label);
//cell = row.insertCell(-1);
cell.appendChild(inputTitle);
var fileInputSpan = curLiEl.getElementsByTagName("span")[0];
var firstNode = curLiEl.childNodes[0];
label = CreateLabel("Upload File : ",radUpload.getID());
curLiEl.insertBefore(label, firstNode);
curLiEl.insertBefore(table, label);
}
<
telerik:GridTemplateColumn
DataField
=
"id"
FilterControlAltText
=
"Filter column column"
HeaderText
=
"Info"
UniqueName
=
"ID_column"
SortExpression
=
"id"
>
<
ItemTemplate
>
<
asp:Image
ID
=
"targetControl"
runat
=
"server"
ImageUrl
=
"images/info16.gif"
/>
</
ItemTemplate
>
Protected Sub Event_Grid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles Event_Grid.ItemCreated
Dim Temp As String = Nothing
Dim Event_Date As Date = Nothing
Dim End_Date As Date = Nothing
If TypeOf (e.Item) Is GridDataItem Then
Try
Event_Date = CDate(e.Item.DataItem("event_date_sort"))
End_Date = CDate(e.Item.DataItem("end_date"))
Dim gdi As GridDataItem = CType(e.Item, GridDataItem)
If End_Date <
Today
Then
gdi.Cells(2)
.BackColor
=
System
.Drawing.Color.Silver
ElseIf (End_Date >= Today) And (Event_Date <= Today) Then
gdi.Cells(2).BackColor = System.Drawing.Color.PaleGreen
ElseIf Event_Date < DateAdd(DateInterval.Month, 1, Today) Then
gdi.Cells(2).BackColor = System.Drawing.Color.Yellow
Else
gdi.Cells(2).BackColor = System.Drawing.Color.WhiteSmoke
End If
If e.Item.DataItem("type_code") = "x" Then
gdi.Cells(2).BackColor = System.Drawing.Color.Tomato
End If
Catch ex As Exception
'leave default shading
End Try
End If
End Sub