Hi, I would like to develop a staff rota system, where the staff member would copy all appointments from a "Master Rota" which they would have previously created onto the current month.
E.G the master rota would contain 4 weeks of appointments, which they can then copy each time on to the current month. They can then do this each month to avoid having to create the appointments each time. I know that you could set a recurring appointment but we would like to have a fixed 4 week rota which can copied onto a month just by clicking a button which would copy all appointments across from this "master rota" onto the Live rota.
Would this be possible?
Hello Everyone ,
In SQL Database i have 3 tables ( articles , category , tbl_article_category ),
and some articles are in 2 or more category , so i want to show this Rad Grid like below :
ID Title Category
1 article1 home , news
any Idea?
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> |
</asp:ScriptManagerProxy> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="gridMain"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="gridMain" LoadingPanelID="RadAjaxLoadingPanel1" /> |
<telerik:AjaxUpdatedControl ControlID="imgSearch" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="imgSearch"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="gridMain" LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center" |
Skin="Vista" /> |
<telerik:RadGrid runat="server" ID="gridMain" Width="50%" Style="margin-left: auto; |
margin-right: auto; margin-top: 5px"> |
<ClientSettings> |
<Scrolling AllowScroll="true" UseStaticHeaders="true" /> |
</ClientSettings> |
<GroupingSettings /> |
<MasterTableView AutoGenerateColumns="false" CommandItemDisplay="Top" AllowPaging="true" |
DataKeyNames="BMID" GroupsDefaultExpanded="false" PageSize="100" EditMode="PopUp" GroupLoadMode="Server"> |
<GroupByExpressions> |
<telerik:GridGroupByExpression> |
<GroupByFields> |
<telerik:GridGroupByField FieldName="BMITEM" FieldAlias="Item" /> |
</GroupByFields> |
<SelectFields> |
<telerik:GridGroupByField FieldName="BMITEM" FieldAlias="Item" /> |
</SelectFields> |
</telerik:GridGroupByExpression> |
</GroupByExpressions> |
<Columns> |
<telerik:GridEditCommandColumn> |
</telerik:GridEditCommandColumn> |
<telerik:GridBoundColumn HeaderText="Status" DataField="BMSTAT"> |
<HeaderStyle Width="25px" /> |
<ItemStyle Width="25px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn HeaderText="Seq." DataField="BMSEQN"> |
<HeaderStyle Width="25px" /> |
<ItemStyle Width="25px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn HeaderText="Child item" DataField="BMCHLD"> |
<HeaderStyle Width="150px" /> |
<ItemStyle Width="150px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn HeaderText="Description"> |
<HeaderStyle Width="150px" /> |
<ItemStyle Width="150px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn HeaderText="Quantity" DataField="BMQTY"> |
<HeaderStyle Width="25px" /> |
<ItemStyle Width="25px" /> |
</telerik:GridBoundColumn> |
</Columns> |
<EditFormSettings EditFormType="Template" InsertCaption="Add new BOM entry" CaptionFormatString="Edit item {0}" |
CaptionDataField="BMID"> |
<PopUpSettings Modal="true" /> |
<FormTemplate> |
<table> |
<tr> |
<td> |
Status |
</td> |
<td class="cellWithTextBox"> |
<asp:DropDownList ID="ddlStatus" runat="server"> |
<asp:ListItem Value="A">Active</asp:ListItem> |
<asp:ListItem Value="D">Disabled</asp:ListItem> |
<asp:ListItem Value="Z">Deleted</asp:ListItem> |
</asp:DropDownList> |
</td> |
</tr> |
<tr> |
<td align="center" colspan="4"> |
<asp:Button ID="btnUpdate" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>' |
runat="server" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'> |
</asp:Button> |
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" |
CommandName="Cancel" /> |
</td> |
</tr> |
</table> |
</FormTemplate> |
</EditFormSettings> |
</MasterTableView> |
</telerik:RadGrid> |
protected void gridMain_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
{ |
LJITDataContext db = new LJITDataContext(); |
IQueryable<LJT_BOM> parts; |
var conditions = PredicateBuilder.True<LJT_BOM>(); |
int startRowIndex = this.gridMain.CurrentPageIndex * this.gridMain.PageSize; |
int maximumRows = this.gridMain.PageSize; |
conditions = conditions.And(p => p.BMITEM.Contains(this.txtFindName.Text)); |
conditions = conditions.And(p => p.BMCHLD.Contains(this.txtFindChild.Text.Trim())); |
parts = db.BOM.Where(conditions).OrderBy(o => o.BMITEM).ThenBy(o => o.BMSEQN); |
this.gridMain.VirtualItemCount = parts.Count(); |
var alles = parts.Skip(startRowIndex).Take(maximumRows); |
this.gridMain.DataSource = parts; |
} |
I am trying to test the custom command button functionality. The function does not appear to run.
aspx
<CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
<CommandItemTemplate>
Custom command item template
<asp:LinkButton ID="TestButton" runat="server" CommandName="Test" >Test</asp:LinkButton>
<br />
</CommandItemTemplate>
C#
protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "Test")
{
string scriptstring = "radalert('Welcome to Rad<b>window</b>!', 330, 210);";
ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);
}
}
Hi,
I had designed ItemTemplate, LayoutTemplate, DataGroupTemplate in RadListView. Its working fine. Right now I am currently grouping by Date.
In my scenario, user can select groupby option either by 'Date' or 'Name'. I tried to declare two DataGroupTemplates, buts its throwing error 'RadListView doesn't have Item place holder specified' . I am pointing to the same ItemPlaceholder(Item Template) in both the DataGroups.
Is there a way to achieve this in RadListView, or should I create two RadListViews for each group and make visible/invisible accordingly.
Please advice,
thank you,
Madhavi
I notice when I have Batch edit and Keyboard navigation, that hitting the ESC key fires the OnBatchEditCellValueChanging event if the value in the editor has changed. I handle this event to process the changed info, but I would think hitting the ESC key would cancel out of any changes. Otherwise, there really doesn't appear to be any way to prevent a changed status once any of the text has been modified.
IMO the ESC key should cancel any changes and take the cell/row out of edit mode without any changed values. Your thoughts? Is there any way to circumvent this behavior? Obviously, if the value is changed, I want to capture that in all instances... except when a user hits the ESC key.
I cant get the item template to reflect the text of the selected item in the radcombobox that is in the edititemtemplate of my programmatically created gridtemplatecolumn
Code for creating the template column:
01.
Dim
tempDB
As
New
SqlDataSource
02.
Dim
templateColumnName
As
String
= col.Caption
03.
Dim
templateColumn
As
New
GridTemplateColumn()
04.
05.
templateColumn.DataField = col.Caption
06.
templateColumn.ItemTemplate =
New
LCDisp(templateColumnName, ddQuery, DiConnectionString)
07.
templateColumn.EditItemTemplate =
New
DDEdit(templateColumnName, ddQuery, DiConnectionString)
08.
templateColumn.HeaderText = templateColumnName
09.
10.
templateColumn.UniqueName = col.Caption
11.
12.
grdReport.Columns.Add(templateColumn)
Code for LCDisp template:
01.
Private
Class
LCDisp
02.
Implements
ITemplate
03.
Protected
lblCont
As
Label
04.
Private
colname
As
String
05.
Private
DSQuery
As
String
06.
Private
DiConnectionString
As
String
07.
08.
Public
Sub
New
(
ByVal
cName
As
String
,
ByVal
query
As
String
,
ByVal
connString
As
String
)
09.
colname = cName
10.
DSQuery = query
11.
DiConnectionString = connString
12.
End
Sub
13.
14.
Public
Sub
InstantiateIn(container
As
UI.Control)
Implements
ITemplate.InstantiateIn
15.
lblCont =
New
Label
16.
lblCont.ID =
"lControl"
+ colname
17.
AddHandler
lblCont.DataBinding,
AddressOf
litCont_DataBinding
18.
container.Controls.Add(lblCont)
19.
End
Sub
20.
21.
Sub
litCont_DataBinding(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
22.
Dim
l
As
Label =
DirectCast
(sender, Label)
23.
Dim
container
As
GridDataItem =
DirectCast
(l.NamingContainer, GridDataItem)
24.
l.Text = (
DirectCast
(container.DataItem, DataRowView))(colname).ToString()
25.
End
Sub
26.
End
Class
Code for DDEdit:
01.
Private
Class
DDEdit
02.
Implements
ITemplate
03.
Protected
DropDown
As
RadComboBox
04.
Private
colname
As
String
05.
Private
DSQuery
As
String
06.
Private
DiConnectionString
As
String
07.
Private
MyContainerDataItem
As
GridDataItem
08.
09.
Public
Sub
New
(
ByVal
cName
As
String
,
ByVal
query
As
String
,
ByVal
connString
As
String
)
10.
colname = cName
11.
DSQuery = query
12.
DiConnectionString = connString
13.
End
Sub
14.
15.
Public
Sub
InstantiateIn(container
As
UI.Control)
Implements
ITemplate.InstantiateIn
16.
DropDown =
New
RadComboBox
17.
18.
Dim
dv2
As
New
DataView
19.
Dim
oQuery
As
New
cWjCoQuery
20.
21.
oQuery.Load(DSQuery, ConfigurationManager.ConnectionStrings(DiConnectionString).ConnectionString)
22.
23.
Dim
tempDB
As
New
SqlDataSource
24.
tempDB.ID = colname +
"DB"
25.
26.
tempDB.SelectCommand = oQuery.SQLQuery
27.
tempDB.ConnectionString = ConfigurationManager.ConnectionStrings(DiConnectionString).ConnectionString
28.
29.
dv2 = tempDB.
Select
(DataSourceSelectArguments.Empty)
30.
DropDown.DataSource = tempDB
31.
If
dv2.Table.Columns.Count > 1
Then
32.
DropDown.DataTextField = dv2.Table.Columns.Item(0).Caption
33.
DropDown.DataValueField = dv2.Table.Columns.Item(1).Caption
34.
Else
35.
DropDown.DataTextField = dv2.Table.Columns.Item(0).Caption
36.
DropDown.DataValueField = dv2.Table.Columns.Item(0).Caption
37.
End
If
38.
39.
DropDown.DataBind()
40.
41.
MyContainerDataItem = TryCast(container.Parent, GridDataItem)
42.
If
MyContainerDataItem
Is
Nothing
Then
43.
MyContainerDataItem = TryCast(container.Parent.Parent, GridDataItem)
44.
End
If
45.
If
MyContainerDataItem IsNot
Nothing
Then
46.
Dim
tmpSelVal = MyContainerDataItem.GetDataKeyValue(colname).ToString
47.
If
Trim(tmpSelVal) <>
""
Then
48.
DropDown.SelectedIndex = DropDown.FindItemIndexByValue(
CInt
(tmpSelVal))
49.
End
If
50.
End
If
51.
52.
container.Controls.Add(DropDown)
53.
End
Sub
54.
End
Class
is there any way to mark by any way a filter button when its filters are being used? I need to know when a filter is being used without having to open it.