I am new to Salesforce VF pages. I have a dynamically binded pageBlockTable in my Visualforce page. I wanted to merge certain dynamic rows based on a condition. Could someone please suggest, if there is any possible way to merge rows(or subrows) in apex:pageblocktable based on some conditions?
I have tried googling this, but could find no clues.
Any help is really appreciated.
Visualforce page code:
<apex:pageblock id="listBlock">
<apex:pageblockTable value="{!lstcomp}" var="oComp" styleclass="table table-striped table-hover" id="sysTable" rowClasses="even,odd">
<apex:column headerClass="TableTitle" style="width: 20%;height:4%" ><apex:facet name="header"><font class="headerfontstyle" >Name</font></apex:facet>
<font class="rowdatastyle"> {!oComp.Name} </font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 10%;height:4%" ><apex:facet name="header"><font class="headerfontstyle" >Mfg</font></apex:facet>
<font class="rowdatastyle" > {!oComp.Manufacturer}</font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 6%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Type</font></apex:facet>
<font class="rowdatastyle" > {!oComp.ComponentType} </font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 12%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Allocated</font></apex:facet>
<font class="rowdatastyle"> {!oComp.Allocated} </font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 10%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Used</font></apex:facet>
<font class="rowdatastyle"> {!oComp.Used} </font>
</apex:column>
<apex:column headerClass="TableTitle" style="width: 30%;height:4%"><apex:facet name="header"><font class="headerfontstyle" >Version</font></apex:facet>
<font class="rowdatastyle">{!oComp.OS} </font>
</apex:column>
</apex:pageblockTable>
You could group your records base on certain conditions and show the rest of fields as from child records.
<apex:pageblockTable>
<apex:column value="{!acc.name}">
<apex:column>
<apex:facet name="header"> Team Members </apex:facet>
<apex:pageblocktable value="{!acc.AccountTeamMembers}" var="tm">
<apex:column headerValue="Team Member">
<apex:outputfield value="{!tm.User.Name}"/>
</apex:column>
<apex:column headerValue="Role">
<apex:outputfield value="{!tm.TeamMemberRole}"/>
</apex:column>
</apex:pageblocktable>
</apex:column>
</apex:pageblockTable>
Related
We have a pretty customized "batch edit" type screen. Out users frequently make changes, then forget to hit Save before moving on to the next page. I have tried the solutions found here:
[a link] http://www.telerik.com/support/code-library/prevent-losing-batch-editing-changes-on-paging-or-any-other-postback
[a link] http://www.telerik.com/forums/prevent-losing-batch-editing-changes-on-paging-or-any-other-postback
But I end up with errors like "RecordNumber" is neither a DataColumn nor a DataRelation. Here's my code. I'm thinking our grid is just too complicated for these straightforward solutions...?
<%# Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="AssignTeacherAdvisor2.aspx.cs" Inherits="AssignTeacherAdvisor2" Theme="LBL" %>
<%# Register Src="Controls/ActionBar.ascx" TagName="ActionBar" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMainAppTop" runat="Server">
<div id="populateTchrIDs" runat="server">
<%-- <script type="text/javascript" language="javascript">
function KGCalChange(sender, eventArgs) {
//debugger;
if (sender.value == "KG") {
showHideLayer('<%= labelKGCal_Search.ClientID %>', 'show');
showHideLayer('<%= comboKGCal_Search.ClientID %>', 'show');
}
else {
showHideLayer('<%= labelKGCal_Search.ClientID %>', 'hide');
showHideLayer('<%= comboKGCal_Search.ClientID %>', 'hide');
}
}
</script>--%>
<script type="text/javascript">
function clientItemChecking(sender, args)
{
if (sender.get_checkedItems().length == 3 && (args.get_item().get_checked() == false))
{
alert("count exceeded");
args.set_cancel(true);
}
}
function clientItemCheckingC(sender, args) {
if (sender.get_checkedItems().length == 5 && (args.get_item().get_checked() == false)) {
alert("count exceeded");
args.set_cancel(true);
}
}
</script>
</div>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<uc1:ActionBar ID="ActionBarTop" runat="server" CancelVisible="True" ExportVisible="True"
SaveVisible="True" Text="Assign Teacher/Advisor" HelpVisible="True" ExportURL="~/DataExport.aspx?frm=AssignTeacherAdvisor2"
OnSaveClick="ActionBar_SaveClick" OnCancelClick="ActionBar_CancelClick" />
<table class="six" style="width: 100%">
<tr>
<td>
<div class="padded header">
Search and Sort
</div>
</td>
<td align="right">
<asp:HyperLink ID="HyperLinkAdvancedSearch" runat="server" NavigateUrl="javascript:ToggleAdvanced();"
class="advancedSearchLink">
Advanced Search</asp:HyperLink>
</td>
</tr>
</table>
<br />
<asp:HiddenField ID="hiddenField" runat="server" />
<asp:Panel ID="PanelSaveSuccess" runat="server" CssClass="infoMessage" Visible="false">
<asp:Label ID="LabelSaveSuccess" runat="server" Text="Information saved successfully." />
</asp:Panel>
<asp:ValidationSummary ID="ValidationSummaryMain" runat="server" />
<asp:CustomValidator ID="CustomValidator1" runat="server" Display="None" ErrorMessage="CustomValidator"></asp:CustomValidator>
<asp:Panel ID="PanelInputs" runat="server" DefaultButton="WebButtonSearch">
<table class="eight" style="width: 100%">
<tr><td colspan = "8" style="text-align: right;">
<sis:InputLabel ID="lblRunReport" runat="server" Text="Report:" Visible="False" />
<telerik:RadComboBox ID="ddlRunReport" runat="server" Width="160px" Visible="False" AutoPostBack="True" OnSelectedIndexChanged="RadComboBoxReport_SelectedIndexChanged">
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</td>
<td>
<sis:WebButton ID="wbtnRunReport" runat="server" CausesValidation="true" ImageUrl="~/App_Themes/LBL/wbtnRunReport.gif"
AutoTipKey="Run Report" UseCssHover="True" OnClick="wbtnRunReport_Click" Visible="False" />
</td></tr>
<tr>
<td class="start">
<sis:InputLabel ID="lblLastName_Search" runat="server" Text="Last Name:" />
</td>
<td class="start data">
<telerik:RadTextBox ID="txtLastName_Search" runat="server">
</telerik:RadTextBox>
</td>
<td class="start">
<sis:InputLabel ID="lblFirstName_Search" runat="server" Text="First Name:" />
</td>
<td class="start data">
<telerik:RadTextBox ID="txtFirstName_Search" runat="server">
</telerik:RadTextBox>
</td>
<td class="start">
<sis:InputLabel ID="lblGrades_Search" runat="server" Text="Grade Level:"></sis:InputLabel>
</td>
<td>
<telerik:RadComboBox ID="lstGrades_Search" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Width ="100px" ></telerik:RadComboBox>
<asp:Literal ID="Literal3" runat="server" />
</td>
<td class="end">
<sis:InputLabel ID="lblTeacherAssigned_Search" runat="server" Text="Teacher Assigned:" />
</td>
<td class="end data">
<telerik:RadComboBox ID="cmbTeacherAssigned_Search" runat="server" Width="75px">
<Items>
<telerik:RadComboBoxItem runat="server" Selected="True" Text=" " />
<telerik:RadComboBoxItem runat="server" Text="Yes" Value="Yes" />
<telerik:RadComboBoxItem runat="server" Text="No" Value="No" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</td>
</table>
<table class="six" style="width: 100%">
<tr>
<td class="start">
<%-- <div id="labelKGCal_Search" runat="server">
<sis:InputLabel ID="lblKGCal_Search" runat="server" Text="KG Calendar:" />
</div>--%>
</td>
<td class="start data">
<%-- <div id="comboKGCal_Search" runat="server" style="width: 301px">
<telerik:RadComboBox ID="cmbKGCal_Search" runat="server" Width="249px" Height="31px">
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</div>--%>
</td>
<td class="end">
</td>
<td class="end data">
</td>
</tr>
</table>
<div id="DivAdvancedSearch" class="advancedSearch" runat="server">
<table class="eight" style="width: 100%">
<tr>
<td class="start">
<sis:InputLabel ID="lblCurrentYearTeacher_Search" runat="server" Text="Current Year Teacher/Advisor:"></sis:InputLabel>
</td>
<td>
<telerik:RadComboBox ID="lstCurrentYearTeacher_Search" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="false" Width ="250px" OnClientItemChecking="clientItemCheckingC" ></telerik:RadComboBox>
<asp:Literal ID="Literal1" runat="server" />
</td>
<td class="start">
<sis:InputLabel ID="lblPriorYearTeacher_Search" runat="server" Text="Prior Year Teacher/Advisor:"></sis:InputLabel>
</td>
<td>
<telerik:RadComboBox ID="lstPriorYearTeacher_Search" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="false" Width ="250px" OnClientItemChecking="clientItemCheckingC"></telerik:RadComboBox>
<asp:Literal ID="Literal2" runat="server" />
</td>
<td class="start">
<sis:InputLabel ID="lblGender" runat="server" Text="Gender:"></sis:InputLabel>
</td>
<td class="start data">
<telerik:RadComboBox ID="cmbGender_Search" runat="server" Width="85px">
<Items>
<telerik:RadComboBoxItem runat="server" Selected="True" Text=" " />
<telerik:RadComboBoxItem runat="server" Text="Male" Value="Male" />
<telerik:RadComboBoxItem runat="server" Text="Female" Value="Female" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</td>
<td class="end">
<sis:InputLabel ID="lblRowsToDisplay_Search" runat="server" Text="Rows to Display:" />
</td>
<td class="end data">
<telerik:RadComboBox ID="cmbRowsToDisplay_Search" runat="server" Width="65px">
<Items>
<telerik:RadComboBoxItem runat="server" Text="10" Value="10" />
<telerik:RadComboBoxItem runat="server" Text="20" Value="20" />
<telerik:RadComboBoxItem runat="server" Text="30" Value="30" />
<telerik:RadComboBoxItem runat="server" Text="50" Value="50" />
<telerik:RadComboBoxItem runat="server" Text="100" Value="100" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="start">
<sis:InputLabel ID="lblFlags_Search" runat="server" Text="Flags (up to 3):"></sis:InputLabel>
</td>
<td>
<telerik:RadComboBox ID="lstFlags_Search" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="false" Width ="250px" OnClientItemChecking="clientItemChecking"></telerik:RadComboBox>
<asp:Literal ID="itemsClientSide" runat="server" />
</td>
<td class="start">
<sis:InputLabel ID="lblIncludeFlag_Search" runat="server" Text="Include Flag:"></sis:InputLabel>
</td>
<td class="start data">
<telerik:RadComboBox ID="cmbIncludeFlag_Search" runat="server" Width="85px">
<Items>
<telerik:RadComboBoxItem runat="server" Selected="True" Text=" " />
<telerik:RadComboBoxItem runat="server" Text="All Flags" Value="A" />
<telerik:RadComboBoxItem runat="server" Text="One or more" Value="O" />
<telerik:RadComboBoxItem runat="server" Text="None of These" Value="N" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</td>
<td class="start">
<sis:InputLabel ID="InputLabelCY" runat="server" Text="Cohort Year:" />
</td>
<td class="start data" align="left" style="width: 138px">
<telerik:RadComboBox ID="RadComboBoxCY_Search" runat="server" TabIndex="4" Width="100px">
<CollapseAnimation Duration="200" Type="OutQuint" />
</telerik:RadComboBox>
</td>
<td class="end">
</td>
<td class="end data">
</td>
</tr>
</table>
<table style="width: 100%" class="six">
<tr>
<td style="width: 121px" class="start" valign="top">
<sis:InputLabel ID="lblDOBFrom_Search" runat="server" Text="DOB Range - From:"></sis:InputLabel>
</td>
<td style="width: 99px" class="start data" valign="top">
<telerik:RadDatePicker ID="dateDOBFrom_Search" runat="server" Width="100px">
<DateInput InvalidStyleDuration="100">
</DateInput>
</telerik:RadDatePicker>
</td>
<td align="right" style="width: 37px" class="start" valign="top">
<sis:InputLabel ID="lblDOBTo_Search" runat="server" Text="To:"></sis:InputLabel>
</td>
<td align="left" style="width: 113px" class="start data" valign="top">
<telerik:RadDatePicker ID="dateDOBTo_Search" runat="server" Width="100px">
<DateInput InvalidStyleDuration="100">
</DateInput>
</telerik:RadDatePicker>
</td>
<td>
</td>
</tr>
</table>
</div>
<table class="eight" style="width: 100%">
<tr>
<td>
<sis:WebButton ID="WebButtonSearch" runat="server" UseCssHover="true" ImageUrl="~/App_Themes/LBL/wbtnSearch.gif"
AutoTipKey="Search" OnClick="WebButtonSearch_Click" AllowLoadBox="True" />
<sis:WebButton ID="WebButtonReset" runat="server" UseCssHover="true" ImageUrl="~/App_Themes/LBL/wbtnReset.gif"
AutoTipKey="Reset" OnClick="WebButtonReset_Click" />
</td>
</tr>
</table>
<asp:Label ID="lblReturnExceedMax" runat="server" CssClass="ListPageStatus"></asp:Label>
</asp:Panel>
<asp:HiddenField ID="HiddenFieldAdvanced" runat="server" />
<br />
<div class="hr">
<hr />
</div>
<table style="width: 100%">
<tr>
<td align="left" style="width: 90px">
<div id="totals" class="padded header" style="width: 93px">
Students
</div>
</td>
<td align="left">
<sis:WebButton ID="WebButtonTotals" runat="server" ImageUrl="~/App_Themes/LBL/wbtnViewTotals.gif"
AutoTipKey="View totals" OnClick="WebButtonTotals_Click" UseCssHover="true" />
</td>
<td><sis:WebButton ID="WebButtonVerify" runat="server"
ImageUrl="~/App_Themes/LBL/wbtnVerify.gif" AutoTipKey="Verify" onclick="WebButtonVerify_Click"
UseCssHover="True" AlertEnabled="True" AlertIcon="Question"
AlertText="You have requested to verify Teacher/Advisor assignments. Would you like to continue?"
AlertTitle="Verify" /></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<telerik:RadGrid ID="grdResults" runat="server" AutoGenerateColumns="False"
AllowCustomPaging="True" AllowPaging="True" OnNeedDataSource="grdResults_NeedDataSource"
OnItemDataBound="grdResults_ItemDataBound" OnItemEvent="grdResults_ItemEvent"
VirtualItemCount="999999" GroupingEnabled="False" >
<ExportSettings>
<Pdf PaperSize="Letter" FontType="Subset"></Pdf>
<Csv RowDelimiter="NewLine" ColumnDelimiter="Comma"></Csv>
</ExportSettings>
<MasterTableView CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR" Frame="Border"
TableLayout="Auto" CommandItemDisplay="None" DataKeyNames="RecordNumber" VirtualItemCount="999999"
AllowCustomPaging="true" EditMode="InPlace" PagerStyle-Position="TopAndBottom">
<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
Visible="False">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
Visible="False" Resizable="False">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="StudentName.FullName" CurrentFilterFunction="NoFilter"
HeaderText="Preferred Name" UniqueName="Name" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Grade" CurrentFilterFunction="NoFilter" HeaderText="Grade"
ReadOnly="true">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="KindergartenCalendar" UniqueName="KGCal" CurrentFilterFunction="NoFilter"
HeaderText="KG Calendar" Display="False" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Current Year Teacher/Advisor" UniqueName="CurrentTchrID"
DataField="CurrentTeacherID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<telerik:RadComboBox ID="RadComboBoxTeacher" runat="server" Height="350px">
</telerik:RadComboBox>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="NextTeacherID" UniqueName="NextTchrID" CurrentFilterFunction="NoFilter"
HeaderText="Prior Year Teacher/Advisor" ReadOnly="true">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
</EditColumn>
<PopUpSettings ScrollBars="None" />
</EditFormSettings>
<NoRecordsTemplate>
No Records Returned
</NoRecordsTemplate>
<PagerStyle Position="TopAndBottom" />
</MasterTableView>
<SortingSettings EnableSkinSortStyles="False" />
<ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder" Resizing-ShowRowIndicatorColumn="False">
<Resizing ResizeGridOnColumnResize="True"
AllowColumnResize="True"></Resizing>
</ClientSettings>
</telerik:RadGrid>
<uc1:ActionBar ID="ActionBarBottom" runat="server" CancelVisible="True" ExportVisible="True"
SaveVisible="True" Text="Assign Teacher/Advisor" HelpVisible="True" ExportURL="~/DataExport.aspx?frm=AssignTeacherAdvisor2"
OnSaveClick="ActionBar_SaveClick" OnCancelClick="ActionBar_CancelClick" />
</telerik:RadAjaxPanel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderFooter" runat="Server">
</asp:Content>
I'm looking for some guidance on how to implement the slickgrid in an ASP.net web application. The application queries a sql server 2005 database and currently uses gridviews to display the data. My goal is to eliminate the use of gridviews and replace them with the slickgrid. My code is below and I'm not sure how or where to start.
In my Dashboard.aspx.cs file (below) you will see that I bind my data to gridviews. How do I replace the databinding to utilize the slickgrid?
Thanks in advance for any help.
Dashboard.aspx page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width: 100%; table-layout: auto; border-top-style: none; border-right-style: none; border-left-style: none; border-collapse: collapse; border-bottom-style: none;">
<tr>
<td rowspan="8" align="center" valign="top">
<asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" Text="Refresh"
Width="100px" />
<br />
<asp:Button ID="Button2" runat="server" PostBackUrl="~/InterfaceListing.aspx" Text="Interface List"
Width="100px" />
</td>
<td style="color: #990000; font-family: Tahoma; height: 1px; text-align: left; width: 124px;">
</td>
<td style="width: 19px; height: 1px">
</td>
<td style="height: 1px; width: 216px;">
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="color: #990000; font-family: Tahoma; height: 1px; text-align: left; width: 124px;">
<span style="font-size: 11pt; vertical-align: top;">
<asp:Label ID="Label2" runat="server" Text="Last 10 Jobs Executed" Width="307px"></asp:Label></span></td>
<td style="width: 19px; height: 1px">
</td>
<td style="height: 1px; width: 216px;">
<span style="font-size: 11pt; color: #990000; font-family: Tahoma">
<asp:Label ID="Label3" runat="server" Text="Interface Summary" Width="185px"></asp:Label></span></td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="width: 124px; text-align: left; vertical-align: top;">
<asp:GridView ID="gvLast10" runat="server" AutoGenerateColumns="False" CellPadding="4"
Font-Names="Tahoma" Font-Size="8pt" ForeColor="#333333"
GridLines="None" Width="800px" >
<RowStyle BackColor="#FFFBD6" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />
<Columns>
<asp:BoundField DataField="InterfaceName" HeaderText="Name" SortExpression="InterfaceName">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="TotalTransactionCount" HeaderText="Transaction Count" SortExpression="TotalTransactionCount">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="ErrorsOccured" HeaderText="Status" SortExpression="ErrorsOccured">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="RunTime" HeaderText="Duration" ReadOnly="True" SortExpression="RunTime">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="Started" HeaderText="Started" SortExpression="DateBegan">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" BorderColor="#990000" BorderStyle="Solid" BorderWidth="1px"
Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</td>
<td style="vertical-align: top; width: 19px; text-align: left">
</td>
<td style="width: 216px; vertical-align: top; text-align: left;">
<asp:GridView ID="gvPackageCount" runat="server" AutoGenerateColumns="False" CellPadding="4"
ForeColor="#333333" GridLines="None" Width="195px" Font-Names="Tahoma" Font-Size="8pt">
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" BorderStyle="Solid" BorderWidth="1px" />
<Columns>
<asp:BoundField DataField="Status" HeaderText="Status" ReadOnly="True" SortExpression="Status"
Visible="False" />
<asp:BoundField DataField="Description" HeaderText="Description" ReadOnly="True"
SortExpression="Description">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Count" HeaderText="Count" ReadOnly="True"
SortExpression="Count">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" BorderColor="#990000" BorderStyle="Solid" BorderWidth="1px" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="width: 124px; color: #990000; background-color: white; height: 19px;">
<span style="font-size: 11pt; font-family: Tahoma">
<br />
<asp:Label ID="Label1" runat="server" Text="Next 10 Jobs Scheduled" Width="236px"></asp:Label></span></td>
<td style="width: 19px; height: 19px">
</td>
<td style="width: 216px; height: 19px;">
<span style="font-size: 11pt; font-family: Tahoma"></span>
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="width: 124px; vertical-align: top; height: 147px;">
<asp:GridView ID="gvNext10" runat="server" AutoGenerateColumns="False" CellPadding="4"
Font-Names="Tahoma" Font-Size="8pt" ForeColor="#333333"
GridLines="None" Width="800px">
<RowStyle BackColor="#FFFBD6" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />
<Columns>
<asp:BoundField DataField="Interfacename" HeaderText="Name" SortExpression="Interfacename">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Next Run" HeaderText="Next Run" ReadOnly="True" SortExpression="Next Run">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" BorderColor="#990000" BorderWidth="1px" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</td>
<td style="width: 19px; height: 147px">
</td>
<td style="width: 216px; height: 147px; vertical-align: bottom; text-align: center;">
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 124px">
</td>
<td style="width: 19px">
</td>
<td style="width: 216px">
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="color: #990000; font-family: Tahoma; height: 1px; text-align: left; width: 124px;">
<span style="font-size: 11pt; vertical-align: top;">
<asp:Label ID="Label4" runat="server" Text="Jobs In Process"
Width="307px"></asp:Label></span></td>
<td style="width: 19px; height: 1px">
</td>
<td style="height: 1px; width: 216px;">
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
<tr>
<td style="color: #990000; font-family: Tahoma; height: 1px; text-align: left; width: 124px;">
<asp:GridView ID="gvInProcess" runat="server" AutoGenerateColumns="False" CellPadding="4"
Font-Names="Tahoma" Font-Size="8pt" ForeColor="#333333"
GridLines="None" Width="800px" >
<RowStyle BackColor="#FFFBD6" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />
<Columns>
<asp:BoundField DataField="InterfaceName" HeaderText="Name" SortExpression="InterfaceName">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Started" HeaderText="Started" SortExpression="DateBegan">
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="RunTime" HeaderText="Duration"
SortExpression="RunTime" ReadOnly="True">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" BorderColor="#990000" BorderStyle="Solid" BorderWidth="1px"
Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</td>
<td style="width: 19px; height: 1px">
</td>
<td style="height: 1px; width: 216px;">
</td>
<td style="width: 20%; height: 19px">
</td>
</tr>
</table>
<br />
<br />
</div>
</form>
</body>
</html>
Dashboard.aspx.cs
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace IntegrationSupport
{
public partial class Dashboard : System.Web.UI.Page
{
ClassData cd = new ClassData();
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt1 = cd.Dashboard("Summary");
gvPackageCount.DataSource = dt1;
gvPackageCount.DataBind();
DataTable dt2 = cd.Dashboard("Last10");
gvLast10.DataSource = dt2;
gvLast10.DataBind();
DataTable dt3 = cd.Dashboard("Next10");
gvNext10.DataSource = dt3;
gvNext10.DataBind();
DataTable dt4 = cd.Dashboard("InProcess");
gvInProcess.DataSource = dt4;
gvInProcess.DataBind();
}
protected void btnRefresh_Click(object sender, EventArgs e)
{
Response.Redirect("~/Dashboard.aspx");
}
}
}
ClassData.cs:
public DataTable Dashboard(string Section)
{
//Get Dashboard Sections...
string sStoredProc = string.Empty;
switch (Section)
{
case "Summary":
sStoredProc = "InterfaceListing_DashboardDataset";
break;
case "Last10":
sStoredProc = "InterfaceListing_Dashboard_6Last10Jobs";
break;
case "Next10":
sStoredProc = "InterfaceListing_Dashboard_7Next10Jobs";
break;
case "InProcess":
sStoredProc = "InterfaceListing_Dashboard_JobsInProcess";
break;
default:
sStoredProc = "";
break;
}
SqlCommand cmd = new SqlCommand();
Open();
cmd.Connection = con;
cmd.CommandText = sStoredProc;
cmd.CommandType = CommandType.StoredProcedure;
Ada = new SqlDataAdapter(cmd);
DataTable dtInterface = new DataTable();
Ada.Fill(dtInterface);
return dtInterface;
}
I'm looking for some guidance on how to implement the slickgrid in an ASP.net web >application. The application queries a sql server 2005 database and currently uses gridviews >to display the data. My goal is to eliminate the use of gridviews and replace them with the >slickgrid. My code is below and I'm not sure how or where to start.
this will help u:
http://www.codeproject.com/Articles/183301/Real-Time-Stock-Quotes-Stock-Alerts-Indicators-Usi
I have a custom object called Conference. I need to create a simple visualforce page that displays all records of Conference including the following details per Conference: Name, City, State, Start Date, End Date, Expected Attendess, and Actual Enrolled. I built this with standard Salesforce.com admin point-and-click, and they all display perfectly in a report I created with point-and-click.
With the following code I'm getting this error:
Error: Unknown property 'Conference__cStandardController.conference'
<apex:page standardStylesheets="false" showHeader="false" sidebar="false"
standardController="Conference__c" recordsetVar="conf">
<apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}"/>
<h1>Conference Details</h1>
<apex:form>
<apex:dataTable value="{!Conference__c}" var="confItem" rowClasses="odd,even">
<apex:column headerValue="Conference Name">
<apex:outputField value="{!confItem.Name}"/>
</apex:column>
<apex:column headerValue="City">
<apex:outputText value="{!confItem.City__c}"/>
</apex:column>
<apex:column headerValue="State">
<apex:outputText value="{!confItem.Location_State__c}"/>
</apex:column>
<apex:column headerValue="Start Date">
<apex:outputText value="{!conference.Start_Date__c}"/>
</apex:column>
<apex:column headerValue="End Date">
<apex:outputText value="{!conference.End_Date__c}"/>
</apex:column>
<apex:column headerValue="Technologies">
<apex:outputText value="{!conference.Technologies__c}"/>
</apex:column>
<apex:column headerValue="Expected">
<apex:outputText value="{!conference.Number_of_Attendees_Expected__c}"/>
</apex:column>
<apex:column headerValue="Currently Enrolled">
<apex:outputText value="{!conference.Enrolled_Attendees__c}"/>
</apex:column>
</apex:dataTable>
</apex:form>
You already refered sObject Conference__c to conf.
Therefore in your dataTable you should write your code like this:
<apex:dataTable value="{!conf}" var="confItem" rowClasses="odd,even">
<apex:column headerValue="Conference Name">
<apex:outputField value="{!confItem.Name}"/>
</apex:column>
and so on
<apex:enhancedList> might be your new best friend.
But if you want to keep the code you have so far you'd need to loop (meaning reference it in dataTable/pageBlockTable/repeat) over the variable name you've chosen as the "recordsetvar" attribute. Check out this link for more info.
Something like that should work:
<apex:page standardStylesheets="false" showHeader="false" sidebar="false"
standardController="Conference__c" recordSetVar="conferences">
<apex:pageBlock>
<apex:pageBlockTable value="{!conferences}" var="c">
<apex:column value="{!c.Name}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
I have a Visualforce toolbar and when I rerender the pageblock only in Firefox the whole bar gets extended vertically to a large toolbar block.
See code below
<apex:toolbar id="theToolbar" style="background-color:#8d8d8d;background-image:none">
<apex:toolbarGroup itemSeparator="line" location="left" id="toobarGroupForm">
<apex:outputText style="color:#f8f8ff;font-weight:bold" value="Amount of Records"/>
<apex:selectList label="Record Amount" value="{!ShowAmountOfRecords}" size="1" required="false" >
<apex:actionSupport event="onchange" action="{!AmountOfRecordsAction}" reRender="innerblock" status="recordamountchange" />
<apex:outputPanel style="color:#f8f8ff;font-weight:bold">
<apex:actionStatus id="recordamountchange" startText="Showing more records..." stopText=""/>
</apex:outputPanel>
<apex:selectOptions value="{!AmountOfRecordsList}"/>
</apex:selectList>
<apex:outputText style="color:#f8f8ff;font-weight:bold" value="Filter By Document Type"/>
<apex:selectList label="Filter by Record Type" value="{!FilterByRecordType}" size="1" required="false" >
<apex:actionSupport event="onchange" action="{!FilterByRecordTypeAction}" reRender="innerblock" status="filterByRecordType" />
<apex:outputPanel style="color:#f8f8ff;font-weight:bold">
<apex:actionStatus id="filterByRecordType" startText="Filtering your records..." stopText=""/>
</apex:outputPanel>
<apex:selectOptions value="{!FilterByRecordTypeList}"/>
</apex:selectList>
</apex:toolbarGroup>
</apex:toolbar>
Is this a know bug in Firefox?
The problem was that I had two picklist part of the same Toolbar Group. Make sure to add your components to different toolbar groups.
<apex:toolbar id="theToolbar" style="background-color:#8d8d8d;background-image:none" rendered="true">
<apex:outputText style="color:#f8f8ff;font-weight:bold" value="Amount of Records"/>
<apex:toolbarGroup itemSeparator="line" location="left" id="toobarGroupForm" rendered="true">
<apex:selectList label="Record Amount" value="{!ShowAmountOfRecords}" size="1" required="false" >
<apex:actionSupport event="onchange" action="{!AmountOfRecordsAction}" status="recordamountchange" reRender="innerblock" />
<apex:outputPanel style="color:#f8f8ff;font-weight:bold">
<apex:actionStatus id="recordamountchange" startText="Showing more records..." stopText=""/>
</apex:outputPanel>
<apex:selectOptions value="{!AmountOfRecordsList}"/>
</apex:selectList>
</apex:toolbarGroup>
<apex:outputText style="color:#f8f8ff;font-weight:bold" value="Filter By Document Type"/>
<apex:toolbarGroup itemSeparator="line" location="left" id="toobarGroupForm2" rendered="true">
<apex:selectList label="Filter by Record Type" value="{!FilterByRecordType}" size="1" required="false" >
<apex:actionSupport event="onchange" action="{!FilterByRecordTypeAction}" status="filterByRecordType" reRender="innerblock"/>
<apex:outputPanel style="color:#f8f8ff;font-weight:bold">
<apex:actionStatus id="filterByRecordType" startText="Filtering your records..." stopText=""/>
</apex:outputPanel>
<apex:selectOptions value="{!FilterByRecordTypeList}"/>
</apex:selectList>
</apex:toolbarGroup>
</apex:toolbar>
Am using a datalist to show the product details. In this time i want to show the image, but it displayed when the image filed having the image path, otherwise it's empty. I want to show the dummy image when the field is empty..
Here is my code:
<asp:DataList ID="DataList1" CaptionAlign="Right" runat="server" Width="100%" Visible="true" >
<ItemTemplate>
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="2%">
</td>
<td>
<div class="Curved_box">
<div class="curved_Top">
<div class="curved_TopLft">
</div>
<div class="curved_TopRft">
</div>
</div>
<div class="CurvedContent">
<a href="#">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 14px; height: 65px;">
</td>
<td style="width: 113px; height: 65px;">
<asp:Image ID="Image1" Style="border: solid 1px #eaeaea; background: " runat="server"
Height="60px" Width="60px" ImageUrl='<%#Bind("fldpic") %>' />
</td>
<td width="80%" align="right" style="height: 65px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" style="height: 20px" align="left">
<asp:Label ID="lbl_name" runat="server" Font-Bold="true" Text='<%#Bind("name") %>'></asp:Label>
</td>
</tr>
<tr>
<td style="width: 247px; height: 20px;" align="left">
<asp:Label ID="lblProd_Keywd" runat="server" Text='<%# Bind("Desig") %>' Font-Bold="True"></asp:Label>
</td>
<td align="left" style="height: 20px">
<asp:Label ID="lblProd_Code" runat="server" Text='<%# Bind("fldempid") %>'
Font-Bold="True"></asp:Label>
</td>
</tr>
<tr>
</tr>
</table>
</td>
</tr>
</table>
</a>
</div>
<div class="curved_Btm">
<div class="curved_BtmLft">
</div>
<div class="curved_BtmRft">
</div>
</div>
</div>
</td>
<td width="2%">
</td>
</tr>
</table>
</ItemTemplate>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" HorizontalAlign="Left" ForeColor="White" />
</asp:DataList>
add onerror attribute on <asp:Image> tag like onerror="this.src = 'url of dummy image'"
change this mark up
<asp:Image ID="Image1" Style="border: solid 1px #eaeaea; background: "
runat="server" Height="60px" Width="60px" ImageUrl='<%#Bind("fldpic") %>' />
to
<asp:Image ID="Image1" Style="border: solid 1px #eaeaea; background: "
runat="server" Height="60px" Width="60px" ImageUrl='<%#Bind("fldpic") %>'
onerror="this.src = 'url of dummy image'" />