03.11.2016 Views

Beginning ASP.NET 4.5 in CSharp and VB Opsylum

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Customiz<strong>in</strong>g the Appearance of the Data Controls x 475<br />

2. At this stage, VS has created columns for the GridView <strong>in</strong> Markup View. To remove those items<br />

<strong>and</strong> def<strong>in</strong>e your own, open the Smart Tasks panel for the GridView <strong>and</strong> click Edit Columns. This<br />

br<strong>in</strong>gs up the Fields dialog box. If the Selected Fields list conta<strong>in</strong>s items, use the Delete button (with<br />

the big X) to clear the list first.<br />

3. In the Available Fields list, select Authorized under BoundField (not the one under CheckBoxField)<br />

<strong>and</strong> then click the Add button to copy the item to the Selected Fields list. Repeat this step for the<br />

CreateDateTime field. Your dialog box now looks like Figure 13-12.<br />

FIGURE 13-12<br />

4. In the Available Fields at the top of the screen, select HyperL<strong>in</strong>kField <strong>and</strong> then click the Add button<br />

to add the item to the Selected Fields list as well. Move the HyperL<strong>in</strong>kField to the top of the<br />

list by click<strong>in</strong>g the button with the up arrow twice. Then, us<strong>in</strong>g the Properties Grid on the right, set<br />

the follow<strong>in</strong>g properties on the HyperL<strong>in</strong>kField:<br />

PROPERTY<br />

HeaderText<br />

DataNavigateUrlFields<br />

DataNavigateUrlFormatStr<strong>in</strong>g<br />

DataTextField<br />

SET ITS VALUE TO<br />

Title<br />

Id<br />

AddEditReview.aspx?Id={0}<br />

Title<br />

5. In the list with Available Fields, click Comm<strong>and</strong>Field <strong>and</strong> click the Add button aga<strong>in</strong>. Then set the<br />

HeaderText of the item you just <strong>in</strong>serted to Delete <strong>and</strong> ShowDeleteButton to True us<strong>in</strong>g the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!