I want to show Sort Icon on a column by default when the RADGrid loads for the firsttime. Currently, the Sort Icon appears only after I click it. Is there any property of RADGrid that shows Sort Icon by default?
'loop through datagrid and set rows with an empty job number to edit mode
For Each gridDataItem As GridDataItem In rgS.MasterTableView.Items
Dim lblJobNum As Label = CType(gridDataItem.FindControl("lblJobNum"), Label)
If (lblJobNum.Text = "") Then
gridDataItem.Edit =
True
End If
Next
| If I omit this loop the data grid will look fine except the rows will not be in |
| edit mode. However, I can click the image button and set them to edit mode |
| manually but I don't want the user to have to do this. Is there something |
| wrong with how I am setting these rows to edit mode? |
RadCodeBlock . when ever we load this page we are getting below error.
Error Details:
Internet explorer cannot open the internet site "operation aborted"
KIndly let us as we are stuckup with code.
- Shrirang
Code :
<
telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<
script type="text/javascript">
//This function opens Contacts Add/Edit Screen
function
ShowContactDetails(ContactId)
{
var page = "ContactDetails.aspx?ID="+ ContactId
var oWnd = $find("RadWindow1");
oWnd.setSize(575,420);
oWnd.setUrl(page);
oWnd.show();
return false;
}
//This function is called when "Import Address Book" is clicked on the ToolBar
function
ShowImportContactDetails()
{
var page = "ImportContacts.aspx"
var oWnd = $find("RadWindow2");
oWnd.setSize(580,230);
oWnd.setUrl(page);
oWnd.show();
return false;
}
//This function is called when "Add" is clicked on the ToolBar.
//This function inturn makes a call to "ShowContactDetails('ContactIds')" function
function
newContact(){
ShowContactDetails(
'0');
}
//This function is called when user opts to add more than one contacts
function
ShowAddMoreContacts()
{
var page = "AddContacts.aspx"
var oWnd = $find("RadWindow1");
oWnd.setSize(400,221);
oWnd.setUrl(page);
oWnd.show();
return false;
}
//This function is called when "Edit" is clicked.
//This function inturn makes a call to "ShowContactDetails('ContactIds')" function
function
editContact(){
if ($find("<%= RadGridContacts.MasterTableView.ClientID %>").get_selectedItems().length == 1)
{
var grid = $find("<%= RadGridContacts.ClientID %>");
var mastertable =grid.get_masterTableView();
var dataitems =mastertable.get_selectedItems();
var selectedContact = mastertable.getCellByColumnUniqueName(dataitems[0],"CONTACT_ID").innerHTML;
ShowContactDetails(selectedContact);
}
else if ($find("<%= RadGridContacts.MasterTableView.ClientID %>").get_selectedItems().length >1)
{
alert(
'Please select only one contact to edit.');
}
else
{
alert(
'Please select a contact to edit.');
}
}
//This function is called when "Export" is clicked on the Toolbar
function
ShowExportContacts(Sortby,fname,lname,email,TeamId)
{
var page = "ExportContacts.aspx?SortColumn="+ encodeURIComponent(Sortby) + "&fname="+ encodeURIComponent(fname) + "&lname="+ encodeURIComponent(lname) + "&email="+ encodeURIComponent(email) + "&TeamId=" + encodeURIComponent(TeamId) ;
var oWnd = $find("RadWindow1");
oWnd.setSize(460,150);
oWnd.setUrl(page);
oWnd.show();
}
//This function is called from Contacts Add/Edit screen to refresh Grid on Contacts Main screen.
function
refreshGrid(arg)
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest(arg);
}
//Use this function to Clear Filters
function
ClearFilters()
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("IBCL:IBCL");
}
//This is called when "Delete" is clicked on ToolBar
function
ClientButtonClicked(sender, args)
{
if(args.get_item().get_value() == "Add Contact with details")
{
newContact();
}
else if(args.get_item().get_value() == "Add a list of email addresses")
{
ShowAddMoreContacts();
}
else if(args.get_item().get_value() == "Delete")
{
if ($find("<%= RadGridContacts.MasterTableView.ClientID %>").get_selectedItems().length <= 0)
{
alert(
'Please select one or more contact(s) to delete.');
return false;
}
else
{
var ans = confirm("Are you sure you want to delete the selected contact(s)?");
if(ans)
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("TBB:"+ args.get_item().get_value());
}
}
}
else if(args.get_item().get_value() == "SendShare")
{
if ($find("<%= RadGridContacts.MasterTableView.ClientID %>").get_selectedItems().length <= 0)
{
alert(
'Please select one or more contact(s).');
return false;
}
else
{
var grid = $find("<%= RadGridContacts.ClientID %>");
var mastertable =grid.get_masterTableView();
var dataitems =mastertable.get_selectedItems();
var selectedEmails = "";
for(var i=0;i<$find("<%= RadGridContacts.MasterTableView.ClientID %>").get_selectedItems().length;i++)
{
selectedEmails = selectedEmails + mastertable.getCellByColumnUniqueName(dataitems[i],
"EMAILADDRESS").innerHTML + ";";
}
FileShare_openTBWin(selectedEmails);
}
}
else if(args.get_item().get_value() == "Export")
{
var generic = document.getElementById('txtGenericSearch').value;
var fname = document.getElementById('txtFirstName').value;
var lname = document.getElementById('txtLastName').value;
var email = document.getElementById('txtEmail').value;
var teamID = $find("<%= RadComboBoxFilterByTeams.ClientID %>").get_selectedItem().get_value();
var sortColumn = document.getElementById('hdnSortColumn').value;
if ((generic != '') && (generic != 'enter text to search...'))
{
fname = generic;
lname = generic;
email = generic;
}
else
{
if (fname == 'enter first name here...')
{
fname =
'';
}
if (lname =='enter last name here...')
{
lname =
'';
}
if(email == 'enter email here...')
{
email =
'';
}
}
if (sortColumn == '')
{
sortColumn =
'CONTACT_ID';
}
ShowExportContacts(sortColumn,fname,lname,email,teamID);
}
else
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("TBB:"+ args.get_item().get_value());
}
}
//This function is called when the selected index event of "Filter by Teams" ComboBox is fired.
function
ClientSelectedIndexChanged(sender, args)
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("CBFBT:"+ args.get_item().get_value());
}
//This function is called when the selected index event of "Generic Search" ComboBox is fired.
function
GenericSearch_SelectedIndexChanged(sender, args)
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("CBGS:"+ args.get_item().get_text());
}
//This function is called to search records based on entries in
// Email, FirstName and LastName textboxes.
function
Search()
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("Search:Search");
}
function
GenericSearch_OnClientItemsRequested(sender,e)
{
// if(sender.get_appendItems())
// e.get_context().CustomText="";
// else
// e.get_context().CustomText=sender.get_text();
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("CBGSIT:"+ sender.get_text());
}
//This function is called to unload RADWindows
function
RadWinUnload()
{
var oWindow = $find("RadWindow1");
oWindow.setUrl(
"../reuse/dummy.htm") ;
}
function RadWinUnload2()
{
var oWindow = $find("RadWindow2");
oWindow.setUrl(
"../reuse/dummy.htm") ;
}
function
showHide()
{
if (document.getElementById('txtGenericSearch').value !='')
{
document.getElementById(
'txtGenericSearch').value='';
}
if(document.getElementById('txtEmail').value !='')
{
document.getElementById(
'txtEmail').value='';
}
if(document.getElementById('txtFirstName').value !='')
{
document.getElementById(
'txtFirstName').value='';
}
if(document.getElementById('txtLastName').value !='')
{
document.getElementById(
'txtLastName').value='';
}
if(document.getElementById('hiddenRow').style.display=='')
{
document.getElementById(
'hiddenRow').style.display='none';
document.getElementById(
'imgMore').src= "../images/icon_more.gif";
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("ASE:N");
}
else if(document.getElementById('hiddenRow').style.display=='none')
{
document.getElementById(
'hiddenRow').style.display='';
document.getElementById(
'imgMore').src= "../images/icon_back.gif";
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("ASE:Y");
}
}
</
script>
</
telerik:RadCodeBlock>
Control Properties set:
<
telerik:RadToolBar ID="RadToolBarContacts" style="width:100%;" Runat="server" Skin="Office2007" OnClientButtonClicked ="ClientButtonClicked">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadToolBar>
<
telerik:RadGrid ID="RadGridContacts" runat="server" CellPadding="0"
Skin="Office2007"
EnableViewState="True" AllowCustomPaging="True"
AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False">
<HeaderContextMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200">
</CollapseAnimation>
</HeaderContextMenu>
<FooterStyle Height="23px" />
<ItemStyle Height="23px" />
<PagerStyle Mode="NextPrevAndNumeric" Wrap="True"
PagerTextFormat="{4} Contacts {2} to {3} of {5}"/>
<MasterTableView DataKeyNames= "CONTACT_ID"
EnableViewState="True" >
<Columns >
<telerik:GridClientSelectColumn UniqueName="clientSelectCol" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" >
<HeaderStyle Width="27px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridClientSelectColumn>
<telerik:GridTemplateColumn UniqueName="AddEdit" HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
<HeaderStyle Width="45px" VerticalAlign="Middle" />
<ItemTemplate>
<asp:ImageButton runat="server" ID="iBtnEditView" ImageAlign="Middle" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="EMAILADDRESS" DataField="EMAILADDRESS"
HeaderText="Email" AllowSorting="true" ShowSortIcon="true"
ItemStyle-HorizontalAlign="Left" >
<HeaderStyle Width="200px" />
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="FIRST_NAME" DataField="FIRST_NAME"
HeaderText="First Name" AllowSorting="true" ShowSortIcon="true"
ItemStyle-HorizontalAlign="Left" >
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="LAST_NAME" DataField="LAST_NAME"
HeaderText="Last Name" AllowSorting="true" ShowSortIcon="true"
ItemStyle-HorizontalAlign="Left" >
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="WORK_PHONE" DataField="WORK_PHONE"
HeaderText="Work Phone" AllowSorting="False" ShowSortIcon="False"
ItemStyle-HorizontalAlign="Left" >
<HeaderStyle Width="100px" />
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="HOME_PHONE" DataField="HOME_PHONE"
HeaderText="Home Phone" AllowSorting="False" ShowSortIcon="False"
ItemStyle-HorizontalAlign="Left" >
<HeaderStyle Width="100px" />
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="CONTACT_ID" DataField="CONTACT_ID"
HeaderText="CONTACT_ID" Display="false" AllowSorting="False"
ShowSortIcon="False" ItemStyle-HorizontalAlign="Left" >
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<HeaderStyle Height="23px" />
<clientsettings AllowColumnHide="True" AllowColumnsReorder="True"
AllowKeyboardNavigation="True" EnableRowHoverStyle="True"
ReorderColumnsOnClient="True">
<Selecting AllowRowSelect="True" />
<clientevents onrowdblclick="editContact" >
</clientevents>
<Scrolling AllowScroll="True" EnableVirtualScrollPaging="True"
UseStaticHeaders="True" />
<Resizing AllowColumnResize="True" ClipCellContentOnResize="False" />
</clientsettings>
<FilterMenu Skin="Office2007" EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200">
</CollapseAnimation>
</FilterMenu>
</telerik:RadGrid>

Good morning:
The scenario is this -- I would like to set up a combo box filter (client-side)
with checkboxes beside the items in that column filter, in order to enable multiple items within a column to be chosen for the viewer
to filter upon.
So far, I haven't had much success in finding this type of item, so my question:
Can this be done/Has this been already done? If so, can you point me in the right direction please?
Thank you - much appreciated.
Chrysa