Showing posts with label Infragistics WebDataGrid. Show all posts
Showing posts with label Infragistics WebDataGrid. Show all posts

Thursday, June 17, 2010

WebDataGrid Numeric Pager Truncates List of Page Numbers

The WebDataGrid Numeric Pager was truncating the list of page numbers after reaching the end of the one line (table width) allocated for the pager display, as shown in the example below. There were scroll bars for the height and width of the data records, but no way to scroll past the end of the line of numbers and see page 21 in this example:



My solution was to create the following Css

<style type="text/css">
.tallPager {
height: 100px;
word-wrap: break-word;
text-align:left;
}
</style>

and apply it to the Paging property


<Behaviors>
<ig:Paging PageSize="25" PagerMode="Numeric" EnableInheritance="True"
PagerCssClass="tallPager" />

etc...

The following shows the pager section for a different table, with the PagerCssClass ="tallPager"


Note: Word wraps can occur in the middle of a page number like 108:


Fortunately, I have a higher class of users and they were able to deal with that.

Tuesday, March 23, 2010

Comparison of ig bound Templated Checkbox to boolean BoundDataField


Shows up as text "true" or "false":
<ig:BoundDataField DataFieldName="IsCostSaving" Key="IsCostSaving" width="30px">
<Header Text="Cost Saving" />
</ig:BoundDataField>

Shows up as a checkbox with checked value picked up from bound field:
<ig:TemplateDataField Key="cb1" width="30px">
<Header Text="Cost Saving" />
<ItemTemplate>
<asp:CheckBox ID="cb1" runat="server" Checked='<%# Eval("IsCostSaving") %>' Enabled="false" />
</ItemTemplate>
</ig:TemplateDataField>

Monday, March 22, 2010

Looping thru Infragistics WebDataGrid on the Server



Took me a while to find this. With some help from ig, thank you Chandradeep!



protected void Button1_Click(object sender, EventArgs e)
{
// loop thru selected cells and get their values
foreach (GridRecordItem itm in WebDataGrid1.Behaviors.Selection.SelectedCells)
{
object ttt = itm.Text ;
}

// example of looping thru selected rows and getting values of columns
foreach (GridRecord row in WebDataGrid1.Behaviors.Selection.SelectedRows)
{
object ttt = row;
GridRecordItem itm = row.Items[0];
string sffssdf = itm.Text;
itm = row.Items[1];
sffssdf = itm.Text;
itm = row.Items[2];
sffssdf = itm.Text;
}

// example of looping thru all rows and getting values of columns
foreach (GridRecord row in WebDataGrid1.Rows)
// foreach (GridRecordItem row in WebDataGrid1.Behaviors.Selection.SelectedCells)
{
object ttt = row;
GridRecordItem itm = row.Items[0];

string sffssdf = itm.Text;
itm = row.Items[1];
sffssdf = itm.Text;
itm = row.Items[2];
sffssdf = itm.Text;
}

// example of looping thru all rows and getting values of a checkbox in a column template field!!!!!
foreach (GridRecord row in WebDataGrid1.Rows)
// foreach (GridRecordItem row in WebDataGrid1.Behaviors.Selection.SelectedCells)
{
CheckBox theCB = (CheckBox)row.Items[0].FindControl("cb1");
bool ischecked = theCB.Checked;
object ttt = row;
GridRecordItem itm = row.Items[0];


string sffssdf = itm.Text;
itm = row.Items[1];
sffssdf = itm.Text;
itm = row.Items[2];
sffssdf = itm.Text;
}


}