This is a migrated thread and some comments may be shown as answers.

[Solved] 3 Grids Rebind

2 Answers 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 14 Jun 2008, 03:03 AM
HI:
I have 3 RadGrids in a webform  to be refresh at the same time,and I Rebind they at the same function, but some one work( the AjaxRequest Handler) and the others do nothing at all. 

function

ShowMARC()

{

try

{

grdDetail.AjaxRequest(

"<%= grdDetail.UniqueID %>", "YES");

}

catch(x)

{

alert(x);

}

}




protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string text)

{

base.RaisePostBackEvent(sourceControl, text);

bool showmarc = false;

if (SQL.ToString(text) == "")

showmarc =

SQL.ToBoolean(Session[WebConstant.Web_Global_ShowMARC]);

if (text == "YES")

showmarc =

true;

else if(text == "NO")

showmarc =

false;

int Itemid = SQL.ToInt(Session[WebConstant.Web_Global_ItemidForDetail]);

Session[

WebConstant.Web_Global_ShowMARC] = showmarc;

GridsDataBind(Itemid, showmarc);

}





protected void GridsDataBind(int intItemID, bool showmarc)

{

grdDetail.DataSource =

null;

grdDetail.Rebind();

grdDetail.DataSource = ShowMarc(showmarc);

grdDetail.Rebind();

 

string strSQLTmp = @" Select t03Identifier, t09LibraryName, t09NickName, t03Location,

t03CallNo as t03CallNo, t03CallNoNormalized, t03CopyBarcode, t03Status, t03DueDate,

Case When t03issueidentifier <= 0 Then t03Volume Else Case

When t72VolumeNo IS NOT NULL AND LTRIM(t72VolumeNo) <> '' Then 'Vol. ' + t72VolumeNo Else '' End +

ISNULL(' Iss. ' + t72IssueNo, '') + ' ' + CONVERT(nvarchar(10), t72MagazineDate, 20) End

As t03Volume, t03issueidentifier , t04FirstName + ' ' + t04LastName CheckoutBy From Copies_t03,libraries_t09,Issue_t72,Patrons_t04

Where t03CheckoutBy *= t04Key And t03IssueIdentifier *= t72Identifier And t09LibraryId = t03LibraryID and t03ItemIdentifier = "

+ intItemID;

string Libraries = "'" + (SQL.ToString(Session[WebConstant.Web_Global_LibraryID])).Replace(",", "','") + "'";

if ((Libraries.EndsWith("'0'")))

{

strSQLTmp = strSQLTmp +

" and t03LibraryID in (" + Libraries + ")";

}

strSQLTmp = strSQLTmp +

@"Order by

ISNULL(Replicate(' ',10-len(ISNULL(t72VolumeNo,''))),'') + ISNULL(t72VolumeNo,''), ISNULL(Replicate('

',10-len(ISNULL(t72IssueNo,''))),'') + ISNULL(t72IssueNo,''), t03Volume "

;

DataTable dt = SQL.ExecuteSQL_fill(strSQLTmp);

grdCopyInformation.DataSource =

null;

grdCopyInformation.Rebind();

grdCopyInformation.DataSource = dt;

grdCopyInformation.Rebind();

Session[

WebConstant.Web_Global_Iteminfomation] = dt;

string PatronKey = (string)Session[WebConstant.Web_Global_PatronKey];

string Sqlstr = @"Select t65ItemIdentifier, t65FileTitle as Title, t65FileType

as FileType, t65AttachFileName as Location, ISNULL(t65CoverImage,0)

t65CoverImage from ItemAttach_t65 where t65ItemIdentifier="

+ intItemID;

dt =

SQL.ExecuteSQL_fill(Sqlstr);

grdMultimedia.DataSource =

null;

grdMultimedia.Rebind();

grdMultimedia.DataSource = dt;

grdMultimedia.Rebind();

Session[

WebConstant.Web_Global_ItemMultimedia] = dt;

}

2 Answers, 1 is accepted

Sort by
0
Nikita Gourme
Top achievements
Rank 1
answered on 16 Jun 2008, 03:14 PM
Jack, have you debugged your code step by step to see whether the data sources for the three grids are updated and their content is refreshed as expected? If those conditions are met all tables should reflect the changes, test it to see how it goes.

Nikita
0
Jack
Top achievements
Rank 1
answered on 19 Jun 2008, 02:28 AM
 Nikita:  
        Thank you, I done it with your help.


Jack.L
BeiJing
china
Tags
Grid
Asked by
Jack
Top achievements
Rank 1
Answers by
Nikita Gourme
Top achievements
Rank 1
Jack
Top achievements
Rank 1
Share this question
or