# TextViewGenerator.AllowDrag Property

> Gets or sets a value indicating whether the view generator can be a source of a Drag&Drop operation. To allow the view generator to accept data, the ServerVisualization.TextViewGenerator.AllowDrop property must be set to true.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.ServerVisualisation`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.ServerVisualization > TextViewGenerator.AllowDrag Property
- **528 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/allowdrag-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/allowdrag-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/allowdrag-property/llms-full.txt

---

### Description

Gets or sets a value indicating whether the view generator can be a source of a Drag&Drop operation. To allow the view generator to accept data, the [ServerVisualization.TextViewGenerator.AllowDrop](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/allowdrop-property/llms-full.txt) property must be set to true.

### Syntax

```csharp
public bool AllowDrag { get; set; }
```

```vbnet
Public Property AllowDrag As Boolean
```

### Examples

The following example applies bold formatting through the text view generator's selection by using `TextViewGenerator.AllowDrag`.

```csharp
Selection formattedSelection = textViewGenerator.Selection;
formattedSelection.Bold = true;
textViewGenerator.Selection = formattedSelection;

textViewGenerator.AllowDrag = true;
if (textViewGenerator.AllowDrag)
{
    Console.WriteLine("Text View Generator: Allow Drag is enabled.");
}
```

```vbnet
Dim formattedSelection As Selection = textViewGenerator.Selection
formattedSelection.Bold = True
textViewGenerator.Selection = formattedSelection

textViewGenerator.AllowDrag = True
If textViewGenerator.AllowDrag Then
    Console.WriteLine("Text View Generator: Allow Drag is enabled.")
End If
```

---

## Nearby

- **Previous:** [TextViewGenerator.ActivationState Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/activationstate-property/llms-full.txt)
- **Next:** [TextViewGenerator.AllowDrop Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/allowdrop-property/llms-full.txt)
