or
protected
void
CustomMatches_TelerikRadGrid3_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
// get the parent customer for whom the custom matches are being searched
GridDataItem parentItem_UnMatchedCustomer_TelerikRADGrid2Row = ((sender
as
RadGrid).NamingContainer
as
GridNestedViewItem).ParentItem
as
GridDataItem;
string
unMatched_MemberID = parentItem_UnMatchedCustomer_TelerikRADGrid2Row.GetDataKeyValue(
"MemberID"
).ToString();
string
unMatched_CustomerID = parentItem_UnMatchedCustomer_TelerikRADGrid2Row.GetDataKeyValue(
"CustomerID"
).ToString();
List<MatchToMember> UnMatchedDetails_PotentialMatches_BindToTelerikRadGrid =
new
List<MatchToMember>();
isCustomSearchExpanded = (sender
as
RadGrid).Visible;
if
(unMatched_CustomerID == customFilterRow_CustomerID)
{
if
(isCustomSearchExpanded && isRadGrid3CurrentlyCustomFiltering)
{
using
(appsEntities appsContext =
new
appsEntities())
{
UnMatchedDetails_PotentialMatches_BindToTelerikRadGrid = appsContext.membership_all
.Select(y =>
new
MatchToMember()
{
CustomerID = unMatched_CustomerID,
MemberDetails = y
})
.Distinct()
.ToList();
}
}
}
if
(UnMatchedDetails_PotentialMatches_BindToTelerikRadGrid !=
null
)
{
(sender
as
RadGrid).DataSource = UnMatchedDetails_PotentialMatches_BindToTelerikRadGrid;
}
//include this if statement so that if the custom search does not return a match, the expanded child datagrid shows "No Records to Display", rather than a blank line.
else
{
(sender
as
RadGrid).DataSource =
new
List<MatchToMember>();
}
//}
wasRadGrid3BindAttempted =
true
;
}
"tempRadGrid3.Rebind();
" in the following code does not cause the "CustomMatches_TelerikRadGrid3_NeedDataSource
" event from above to be called, as I was hoping that it would.protected
void
CustomMatches_TelerikRadGrid3_ItemCommand(
object
sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.FilterCommandName)
{
// get the parent customer for whom the potential matches are being searched
GridDataItem parentItem_UnMatchedCustomer_TelerikRADGrid1Row = ((sender
as
RadGrid).NamingContainer
as
GridNestedViewItem).ParentItem
as
GridDataItem;
string
unMatched_MemberID = parentItem_UnMatchedCustomer_TelerikRADGrid1Row.GetDataKeyValue(
"MemberID"
).ToString();
string
unMatched_CustomerID = parentItem_UnMatchedCustomer_TelerikRADGrid1Row.GetDataKeyValue(
"CustomerID"
).ToString();
isRadGrid3CurrentlyCustomFiltering =
true
;
customFilterRow_CustomerID = unMatched_CustomerID;
if
(wasRadGrid3BindAttempted)
{
RadGrid tempRadGrid3 = sender
as
RadGrid;
tempRadGrid3.Rebind();
}
}
}
// Hack3: keep track of whether or not the Custom Search is expanded
bool
isCustomSearchExpanded =
false
;
// Hack 4: determine if currently custom searching for State Bar member
bool
isRadGrid3CurrentlyCustomFiltering =
false
;
// Hack 5: keep track of which row of Customer is expanded for custom search
string
customFilterRow_CustomerID;
// Hack 6:
bool
wasRadGrid3BindAttempted;
<
telerik:RadToolTip
ID
=
"RadToolTip_feesandcharges"
runat
=
"server"
TargetControlID
=
"RadButton_feesandcharges"
Title
=
"Fees and Charges"
ShowEvent
=
"OnClick"
Position
=
"Center"
HideEvent
=
"ManualClose"
ContentScrolling
=
"Auto"
Width
=
"300px"
Height
=
"300px"
RelativeTo
=
"BrowserWindow"
Style
=
"display: none;"
Skin
=
"WebBlue"
Modal
=
"true"
RenderInPageRoot
=
"true"
RenderMode
=
"Lightweight"
>